Yii: Unit test models without database server -
A database server (or without access to other external resources) preferred / correct way to test unit against Yii model What is it )? I have found that all the unit test documents show that you have an active database server, but it is obvious that this unit is not ideal for testing.
The value for which it is, here is my configuration / test I Php and my bootstrap.php:
& lt ;? Php return CMap :: mergeArray (required (dirname (__ file __). '/ Main.php'), array ('component' => array ('stability ='; array ('class' = & gt; 'System.test.CDbFixtureManager',),),))); and
& lt ;? Php // If necessary, change the following path $ yiit = dirname (__ file __). '/ .. / .. / Yii-1.1.13.e9e4a0 / outline / yiit.php'; $ Config = dirname (__ File __) '/ .. / config / test.php'. Require_once ($ yiit); Need_once (dirname (__ file __) '/ WebTestCase.php'.); Yii :: createWebApplication ($ config); And when I run this test:
CDbException: CDbConnection.connectionString can not be empty. I can think that the only option, to use SQLite and a DB Will file with its unit tests, but it has certain limitations, e.g. It does not support the foreign key and some other features from "real" DB, if you want to test the model, then after all, you require some type of DB
Comments
Post a Comment