<?phpclassPostTestextendsWebTestCase{/** * We use the 'Post' only for this test. * @see CWebTestCase::fixtures */public$fixtures=array('posts'=>'Post',);publicfunctiontestIndex(){$this->open('');// verify header title exists$this->assertTextPresent('Yii Blog Demo');// verify the sample post title exists$this->assertTextPresent($this->posts['sample1']['title']);}publicfunctiontestView(){$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');}}