apprentice (77) [Avatar] Offline
#1
I typed this command in Vista's cmd and got a lot of weird messages back:

$ phpunit PlacesTest.php

What am I doing wrong? I don't know what to fix please point me in the right direction.

______________________________________________________________________

Csmilierogram FilesApache Software FoundationApache2.2htdocszfiach03places e
stsmodels>phpunit PlacesTest.php

PHP Warning: require_once(../application/models/Places.php): failed to open str
eam: No such file or directory in Csmilierogram FilesApache Software FoundationAp
ache2.2htdocszfiach03places estsmodelsPlacesTest.php on line 4

PHP Fatal error: require_once(): Failed opening required '../application/models
/Places.php' (include_path='.;csmilierogram FilesPHPPEAR;Csmilierogram FilesApache
Software FoundationApache2.2htdocszfialib;Csmilierogram FilesApache Software F
oundationApache2.2htdocszfiach03places/library/;Csmilierogram FilesApache Sof
tware FoundationApache2.2htdocszfiach03places/application/models/') in Csmilie
rogram FilesApache Software FoundationApache2.2htdocszfiach03places ests\r
modelsPlacesTest.php on line 4

Csmilierogram FilesApache Software FoundationApache2.2htdocszfiach03places estsmodels>

______________________________________________________________________
apprentice (77) [Avatar] Offline
#2
Re: Chapter 3: phpunit PlacesTest.php - problems
I fixed it myself wohoo smilie


1.
You need to be in the "/htdocs/zfia/ch03/places/tests/" folder for the unit test to work.
Typing the CLI in this folder is wrong "/htdocs/zfia/ch03/places/tests/models/".


2.
I had to add these privileges for my user "zfia" in order to run this particular unit test.

* Drop
* Create

Previously in phpMyAdmin I just created my "zfia" user with these privileges for security reasons:

* Select
* Insert
* Update
* Delete

and because my webhost doesn't allow DROP and CREATE commands. So I wanted to be ready with a unit test simulation that would also work on my webhost and not only on my own WAMP testing server.


3.
Also the CLI is supposed to be like this:

$ phpunit models_PlacesTest

and not like this:

$ phpunit PlacesTest.php

_________________________________________________________________

Csmilierogram FilesApache Software FoundationApache2.2htdocszfiach03places e
sts>phpunit models_PlacesTest

PHPUnit 3.3.17 by Sebastian Bergmann.

..

Time: 0 seconds

OK (2 tests, 3 assertions)

Csmilierogram FilesApache Software FoundationApache2.2htdocszfiach03places e
sts>

_________________________________________________________________
akrabat (479) [Avatar] Offline
#3
Re: Chapter 3: phpunit PlacesTest.php - problems - [SOLVED]
Good writeup on how you got it going.

Thanks for sharing smilie

Regards,

Rob...