Added DB Access + Error page
This commit is contained in:
30
demos/blog/protected/tests/functional/PostTest.php
Normal file
30
demos/blog/protected/tests/functional/PostTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
class PostTest extends WebTestCase
|
||||
{
|
||||
/**
|
||||
* We use the 'Post' only for this test.
|
||||
* @see CWebTestCase::fixtures
|
||||
*/
|
||||
public $fixtures=array(
|
||||
'posts'=>'Post',
|
||||
);
|
||||
|
||||
public function testIndex()
|
||||
{
|
||||
$this->open('');
|
||||
// verify header title exists
|
||||
$this->assertTextPresent('Yii Blog Demo');
|
||||
// verify the sample post title exists
|
||||
$this->assertTextPresent($this->posts['sample1']['title']);
|
||||
}
|
||||
|
||||
public function testView()
|
||||
{
|
||||
$this->open('post/1/xyz');
|
||||
// verify the sample post title exists
|
||||
$this->assertTextPresent($this->posts['sample1']['title']);
|
||||
// verify comment form exists
|
||||
$this->assertTextPresent('Leave a Comment');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user