Selenium tests are using the dev db instead of the test db

hi all,

I’m doing some selenium test cases using the yii webdriver extension and I have a problem with the databases. I have the DEV database and the TEST database which I configured in the main.php and in the test.php. The fixtures, the unit test cases and the setup of the selenium’s tests works perfectly in the TEST database, but when the browser is being used by selenium, it uses the DEV database.

Here are the codes:


<phpunit bootstrap="bootstrap.php"







		<browser name="Internet Explorer" browser="*iexplore" />

		<browser name="Firefox" browser="*firefox" />





// change the following paths if necessary




//require_once(dirname(__FILE__).'/WebTestCase.php'); - since I'm using the webdriver extension, this is not necessary


Anyone has any idea why the override is not working?

appreciate it

Did you set TEST_BASE_URL correctly (it would be in WebTestCase class normally, not using the exstension) to index-test.php?

Hi, here it is



 * Change the following URL based on your server configuration

 * Make sure the URL ends with a slash so that we can use relative URLs in test cases




 * The base class for functional test cases.

 * In this class, we set the base URL for the test application.

 * We also provide some common methods to be used by concrete test classes.


class WebTestCase extends CWebTestCase



	 * Sets up before each test method runs.

	 * This mainly sets the base URL for the test application.


	protected function setUp()






here is the index-test.php



 * This is the bootstrap file for test application.

 * This file should be removed when the application is deployed for production.


// change the following paths if necessary



// remove the following line when in production mode

defined('YII_DEBUG') or define('YII_DEBUG',true);



thank you for the help

Hm, looks normal.

If you enter http://localhost/Rafao_server/Yii_KombatoOnline/index-test.php/ directly to browser - do you get your test environment?

In you .htaccess file maybe you need to have redirects to index-test.php instead of index.php (if you get rid of index file in your urls)?

Sorry, but these are all ideas I have at the moment :).

You were RIGHT. It was the htaccess that was redirecting to the index.php. thank you.

Now I have to figure out how to have two htaccess, if that is possible.

thank you once more

Welcome and nice to hear you’ve found the problem :)