Unit Test : fixture in sub folder

Hi,

I have written many unit tests classes and in order to get things simple, I have also distributed fixtures into sub-folder. Here is the structure :


 

./tests

	--- fixtures

        	model1.php

        	model2.php

 			--- set1

     				model1.php

     				model2.php

	--- unit

   		A_Test.php

   		B_Test.php



A_Test uses fixtures in ./fixture, and B_Test uses the ones in ./fixture/set1, by changing the fixtureManager basePath :


protected function setUp()

{

	$this->getFixtureManager()

 		->basePath = Yii::getPathOfAlias('application.tests.fixtures.set1');

	parent::setUp();

}

Now everything works fine when I run both unit test cases individually, but when I try to run all tests cases in folder ./unit (using % phpunit --coverage-html ./report unit), fixtures stored in the set1 subfolder are not applied, and of course, B_Test fails.

Any idea why this happens is very welcome.

ciao

B)

Ok I will reply to my own post (in case someone is intrested).

It is not possible to change the basePath fixture Manager at runtime (in the setUp method for example), because the fixtureManager component loads all fixtures when it is initialized (init()). At this time, the basePath used is the one that is set in the component initialization array.

ciao

B)