0


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?

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.