Reputation: 453
When I run my functional test
phpunit functional/LoginTest.php
It starts my page in browser
$this->open('http://mysite.com/');
But it uses index.php
instead of index-test.php
and I have no idea why.
In WebTestCase
class there is a constant
define('TEST_BASE_URL','http://mysite.com/index-test.php/');
and the setUp method of WebTestCase
protected function setUp()
{
parent::setUp();
$this->setBrowser('*googlechrome');
$this->setBrowserUrl(TEST_BASE_URL);
}
Please, tell me why does it keep calling index.php
instead of index-test.php
?
Upvotes: 0
Views: 739
Reputation: 1737
Because $this->open('http://mysite.com/');
this absolute url.
If you use it, you must do so: $this->open('http://mysite.com/index-test.php');
If you use relative URL, you must do so: $this->open(''); - this open TEST_BASE_URL
And once again reread the http://www.yiiframework.com/doc/guide/1.1/en/test.functional
Upvotes: 2