Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fatal error: Class 'PHPUnit_Framework_Assert' not found in ...

686 views
Skip to first unread message

xanas

unread,
Sep 13, 2013, 5:09:14 AM9/13/13
to
require_once 'PHPUnit/Framework/TestCase.php';

class MyDBTest extends PHPUnit_Framework_TestCase {}



Perchè compare l'errore
Fatal error: Class 'PHPUnit_Framework_Assert' not found in ...
???

PAOLO FRANCESCO Bertolotti

unread,
Sep 13, 2013, 5:41:48 AM9/13/13
to
You should not be loading / require

require_once 'PHPUnit/Framework/TestCase.php';
in your tests at all. The normal phpunit runner should be able to figure that out.

Usually IDEs should care about setting phpunit up properly (or invoking it properly) but if that doesn't work out requiring

require_once 'PHPUnit/Autoload.php';
That should do the trick then as this is whats needed to make PHPUnit working

TRATTO DA http://stackoverflow.com/questions/8140534/php-class-resolve-issue-for-classes-in-the-same-directory-when-running-phpunit-t

xanas

unread,
Sep 13, 2013, 6:01:37 AM9/13/13
to
Il Fri, 13 Sep 2013 02:41:48 -0700, PAOLO FRANCESCO Bertolotti ha scritto:
> TRATTO DA
> http://stackoverflow.com/questions/8140534/php-class-resolve-issue-for-
classes-in-the-same-directory-when-running-phpunit-t

Warning: require_once(File/Iterator/Autoload.php): failed to open stream:
No such file or directory in .../PHPUnit/Autoload.php on line 64

Marco Albarelli (fu Motosauro) @fisso

unread,
Sep 13, 2013, 7:43:49 AM9/13/13
to
Incolla qui il comando esatto che fallisce e il risultato di
php -i | grep PATH


--
I fatti mi cosano

xanas

unread,
Sep 13, 2013, 10:37:03 AM9/13/13
to
Il Fri, 13 Sep 2013 13:43:49 +0200, Marco Albarelli (fu Motosauro) @fisso
ha scritto:

> Incolla qui il comando esatto che fallisce

????

> e il risultato di php -i | grep PATH

LIBGL_DRIVERS_PATH => /usr/lib/fglrx/dri:/usr/lib/i386-linux-gnu/dri:/usr/
lib/dri
XDG_SESSION_PATH => /org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH => /org/freedesktop/DisplayManager/Seat0
DEFAULTS_PATH => /usr/share/gconf/ubuntu.default.path
PATH => /home/rino/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/
local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
MANDATORY_PATH => /usr/share/gconf/ubuntu.mandatory.path
COMPIZ_BIN_PATH => /usr/bin/
_SERVER["LIBGL_DRIVERS_PATH"] => /usr/lib/fglrx/dri:/usr/lib/i386-linux-
gnu/dri:/usr/lib/dri
_SERVER["XDG_SESSION_PATH"] => /org/freedesktop/DisplayManager/Session0
_SERVER["XDG_SEAT_PATH"] => /org/freedesktop/DisplayManager/Seat0
_SERVER["DEFAULTS_PATH"] => /usr/share/gconf/ubuntu.default.path
_SERVER["PATH"] => /home/rino/bin:/usr/lib/lightdm/lightdm:/usr/local/
sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/
games
_SERVER["MANDATORY_PATH"] => /usr/share/gconf/ubuntu.mandatory.path
_SERVER["COMPIZ_BIN_PATH"] => /usr/bin/
_SERVER["PATH_TRANSLATED"] =>

Marco Albarelli (fu Motosauro) @fisso

unread,
Sep 13, 2013, 12:38:47 PM9/13/13
to
Il 13/09/2013 16:37, xanas ha scritto:
> Il Fri, 13 Sep 2013 13:43:49 +0200, Marco Albarelli (fu Motosauro) @fisso
> ha scritto:
>
>> Incolla qui il comando esatto che fallisce
>
> ????
utente@macchina $ phpunit -v -c qualchefile.xml <==== TIPO QUESTO
Ovviamente anche tutto l'output che lo segue
dai anche
which phpunit

>
>> e il risultato di php -i | grep PATH
> cut ...
Questo sembra a posto

xanas

unread,
Sep 13, 2013, 1:02:12 PM9/13/13
to
Il Fri, 13 Sep 2013 18:38:47 +0200, Marco Albarelli (fu Motosauro) @fisso
ha scritto:

> Il 13/09/2013 16:37, xanas ha scritto:
>> Il Fri, 13 Sep 2013 13:43:49 +0200, Marco Albarelli (fu Motosauro)
>> @fisso ha scritto:
>>
>>> Incolla qui il comando esatto che fallisce
>>
>> ????
> utente@macchina $ phpunit -v -c qualchefile.xml <==== TIPO QUESTO
> Ovviamente anche tutto l'output che lo segue dai anche which phpunit
>

$ phpunit -v -c .../phpunit/testcase.class.php
Could not load ".../phpunit/testcase.class.php".
ParsePI: PI php never end ...
Start tag expected, '<' not found

$ which phpunit
/usr/bin/phpunit

xanas

unread,
Sep 16, 2013, 10:18:57 AM9/16/13
to
Niente?
Ho provato anche in win, stessa cosa.

mindtricks....@gmail.com

unread,
Aug 31, 2016, 9:40:04 AM8/31/16
to

mindtricks....@gmail.com

unread,
Aug 31, 2016, 9:41:57 AM8/31/16
to
Fatal error: Class 'PHPUnit_Framework_Assert' not found in D:\xampp\php\pear\PHPUnit\Framework\TestCase.php on line 98
0 new messages