Strange error from phpunit
Posted 10 October 2010 - 01:28 PM
I've got an strange error from phpunit.
root@xme-laptop:/var/www/trackstar2/protected/tests# phpunit unit/
EPHP Fatal error: Call to a member function load() on a non-object in /var/www/yii/framework/test/CDbTestCase.php on line 116
where is the problem?
Posted 19 October 2010 - 06:12 PM
I had something similar and it's because I put the authMan RBAC at the bottom of the main.php file... I ended up putting it just under the DB connection component like the source code.
Posted 20 October 2010 - 10:10 PM
One thing you could do is to fire up the yiic interactive shell, loading your test config
% YIIROOT/framework/yiic shell protected/config/test.php
And then see if you can retrieve an instance of the fixture mgr:
You should get back a CDbFixtureManager Object. If not this may display a DB error which will help you further troubleshoot the issue.
Posted 16 December 2010 - 06:24 AM
I undid everything and the tests worked so then slowly added parts back in - I found that simply adding a file to the fixtures area caused issue (protected/tests/fixtures/tbl_user.php).
I fixed this by adding in more data to the fixtures file - the book has empty entries for login and create times and id's - by making sure all fixture entries have data the error goes.
Might be useful to someone ?!
(Probably my stricter data definitions in the database...)
(Using Yii 1.1.4 too which probably doesn't help but there shouldn't be too many issues I'm hoping).
Posted 11 March 2011 - 02:39 PM
I just had the same problem. Your suggestion revealed something wrong with my database connectivity.
I restarted my wampserver and my problems went away.
I don't want to admit how much other crazy stuff I was trying to do to resolve this error.