Re: A NewBee Question...
| From: | Michael Thompson | Date: | Sat, 04 Oct 2008 19:58:29 +0000 |
| Subject: | Re: A NewBee Question... | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-11120@lists.php.net to get a copy of this message | ||
To Whom It May Concern,
I copied the PHPUnit-1.3.2 files in my PHP directory; so far so good...
I did the first example at www.ip97.com/pear/packages.php.phpunit.intro.html; it worked, almost. What did I do wrong that generated the following error statement:
$ php -f StringTestRun.php
at 00
at 01
at 02
at 03
Catchable fatal error: Object of class String could not be converted to string in /usr/share/php/PHPUnit/Assert.php on line 174
Call Stack:
0.0005 64440 1. {main}() /workspace/phpUnitClass/StringTestRun.php:0
0.0098 307772 2. PHPUnit::run() /workspace/phpUnitClass/StringTestRun.php:13
0.0099 308120 3. PHPUnit_TestSuite->run() /workspace/phpUnitClass/PHPUnit-1.3.2/PHPUnit.php:119
0.0105 320164 4. PHPUnit_TestCase->run() /usr/share/php/PHPUnit/TestSuite.php:184
0.0105 320164 5. PHPUnit_TestResult->run() /usr/share/php/PHPUnit/TestCase.php:170
0.0105 320164 6. PHPUnit_TestCase->runBare() /usr/share/php/PHPUnit/TestResult.php:246
0.0105 320164 7. PHPUnit_TestCase->runTest() /usr/share/php/PHPUnit/TestCase.php:182
0.0105 320164 8. call_user_func() /usr/share/php/PHPUnit/TestCase.php:198
0.0105 320164 9. StringTest->testCopy() /usr/share/php/PHPUnit/TestCase.php:0
0.0106 320164 10. PHPUnit_Assert->assertEquals() /workspace/phpUnitClass/StringTest.php:61
0.0106 320164 11. sprintf() /usr/share/php/PHPUnit/Assert.php:174
at 04
TestCase StringTest->testToString() failed: expected TRUE, actual FALSE in /workspace/phpUnitClass/StringTest.php:54
TestCase StringTest->testCopy() failed: expected , actual in /workspace/phpUnitClass/StringTest.php:61
TestCase StringTest->testAdd() failed: expected TRUE, actual FALSE in /workspace/phpUnitClass/StringTest.php:71
at 05
$ php -version
PHP 5.2.4-2ubuntu5.3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 23 2008 06:44:49)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Xdebug v2.0.2, Copyright (c) 2002-2007, by Derick Rethans$ cat StringTestRun.php <?php echo "at 00\n"; require_once 'StringTest.php'; echo "at 01\n"; require_once 'PHPUnit.php'; echo "at 02\n"; $suite = new PHPUnit_TestSuite ( "StringTest" ); echo "at 03\n"; $result = PHPUnit::run ( $suite ); echo "at 04\n"; echo $result->toString ( ); echo "at 05\n"; ?> Regards, Michael