I’ve got an strange error from phpunit.
[b]root@xme-laptop:/var/www/trackstar2/protected/tests# phpunit unit/
[b]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?
What chapter are you on…? Is that the exact msg you got from phpunit?
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.
This can often be the result of an underlying database connection issue.
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.
I was having the same issue with chapter 3 ‘Adding Tasks’ (page 124/125 ‘Adding User and ProjectUserAssignment fixtures’).
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).
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.