Hi everyone
I’m trying to run a testunit for a post, but the application is not able to locale the WebTestCase file.
I’m using Yii 1.1.2 and PHPunit.
Here’s my PostTest.php located in the functional folder:
class PostTest extends WebTestCase {
public $fixtures=array(
'posts'=>'Post',
);
public function testShow()
{
$this->open('post/1');
// verify the sample post title exists
$this->assertTextPresent($this->posts['sample1']['title']);
// verify comment form exists
$this->assertTextPresent('Leave a Comment');
}
Here’s my test.php which is in the config folder:
<?php
return CMap::mergeArray(
require(dirname(__FILE__).'/main.php'),
array(
'components'=>array(
'fixture'=>array(
'class'=>'system.test.CDbFixtureManager',
),
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=forum',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'pass55',
'charset' => 'utf8',
'tablePrefix' => '',
),
),
)
);
And the bootstrap.php is located in the tests folder.
What i’m missing ? it’s look like the application is not able to initiate the bootstrap.php file !! and if i should initialize it, where i should do this ? because i read the tutorial about the TestUnit, and i didn’t see where the bootstrap should be initialized.
Thanks