I encountered the following problem: While the first test (test function) is executed properly, I am always getting strange errors from the following tests. If I put all tests into one large function (separated by $this->setUp()), everything works fine.
I am running XAMPP. The problem occures with Yii 1.1alpha and yesterday’s nightly.
Everything is reproducible with demos/blog/protected/tests/unit/CommentTest.php (i.e. the error message as well as the "workaround" with one large test function with $this->setUp()).
With demos/blog/protected/tests/unit/CommentTest.php it is
1) CommentTest::testApprove
array_keys() expects parameter 1 to be array, null given
D:\progs\xampp\yii\framework\db\ar\CActiveRecord.php:511
D:\progs\xampp\yii\framework\base\CModel.php:423
D:\progs\xampp\yii\demos\blog\protected\tests\unit\CommentTest.php:45
But with my tests, I got other errors as well, e.g.
Invalid argument supplied for foreach()
D:\progs\xampp\yii\framework\test\CDbFixtureManager.php:345
D:\progs\xampp\yii\framework\test\CDbTestCase.php:73