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');
}
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.
Just wrote out a reply to this, only to have the website tell me (after I’d written the reply) “Sorry, please wait 10 minutes before replying” - and then it destroyed my reply. How annoying / poor is that?
Is it a regular occurrence to have no answer to questions posted over a year ago? I really hope not as it will making using Yii a nightmare.
I’m also having the same problem and using PHPUnit 3.5.14.
There’s also another similar question here: phpunit-functionalsitetest-error
The answer there seems to be ‘upgrade PHPUnit’ - which I have done… still no joy.
In my case the functional tests didn’t run cause i had a to old phpunit version (=>I update to 3.5.14 via sudo pear upgrade) and had not installed the selenium extension for phpunit.
See my post in this thread and install PHPUnit_Selenium extension via pear.
For me it solves the problem to be not able to run functional tests.
I had the same issue and I figured it out the problem occurs when I try to run the tests outside of the tests folder. call the command from there works like it should be.