This .PHPT test completes: (from PHPT docs)
File: strtr.phpt
--TEST--
strtr() function - basic test for strstr()
--FILE--
<?php
/* Do not change this test it is a README.TESTING example. */
$trans = array("hello"=>"hi", "hi"=>"hello", "a"=>"A", "world"=>"planet");
var_dump(strtr("# hi all, I said hello world! #", $trans));
?>
--EXPECT--
string(32) "# hello All, I sAid hi planet! #"
$ pear run-tests --cgi strtr.phpt
Output:
Running 1 tests
PASS strtr() function - basic test for strstr()[uploadTest.phpt]
TOTAL TIME: 00:00
1 PASSED TESTS
0 SKIPPED TESTS
However, when I try running another example test, like sample006.phpt
, and any other test that uses --GET--
, --POST--
, --POST_RAW--
, etc., sections, the tests always fail.
My Big Picture Goal is to test file uploads in PHPUnit by way of PHPT as described in Testing file uploads with PHP. The --POST_RAW--
example used in that article fails for me as well, whereas the other examples pass successfully.
It would appear I have a local config problem, but I have no idea where I would track this down. Not much in Google, unfortunately.
One thing I've noticed between these --POST--
tests failing, and other regular tests failing, is that the regular test failures always populate the *.out
file with the failed output of the script. The --POST--
tests that fail do not have anything in the *.out
file, even when I am explicitly outputting text.
Do those example PHPT tests using --POST_RAW--
work for anyone else?
Here are my system specs: (php 5.2, os x 10.6)
$ pear -V
PEAR Version: 1.9.1
PHP Version: 5.2.13
Zend Engine Version: 2.2.0
Running on: Darwin mbp.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386