Hi,
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?
thx!
Page 1 of 1
Strange error from phpunit
#1
Posted 10 October 2010 - 01:28 PM
Meine Fragen stelle ich öffentlich und baue somit eine Wissensdatenbank für andere auf!
#2
Posted 19 October 2010 - 06:12 PM
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.
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.
#3
Posted 20 October 2010 - 10:10 PM
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
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.
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:
>> print_r(Yii::app()->getComponent('fixture'));You should get back a CDbFixtureManager Object. If not this may display a DB error which will help you further troubleshoot the issue.
#4
Posted 16 December 2010 - 06:24 AM
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).
Ed
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).
Ed
#5
Posted 11 March 2011 - 02:39 PM
thanks jefftulsa!
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.
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.
Share this topic:
Page 1 of 1

Help












