此 .PHPT 测试完成:(来自 PHPT 文档)
文件: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
输出:
Running 1 tests
PASS strtr() function - basic test for strstr()[uploadTest.phpt]
TOTAL TIME: 00:00
1 PASSED TESTS
0 SKIPPED TESTS
但是,当我尝试运行另一个示例测试(例如,以及使用、、等部分的sample006.phpt
任何其他测试)时,测试总是失败。--GET--
--POST--
--POST_RAW--
我的大图目标是通过 PHPT 测试 PHPUnit 中的文件上传,如使用 PHP 测试文件上传中所述。--POST_RAW--
那篇文章中使用的示例对我来说也失败了,而其他示例成功通过。
看来我有一个本地配置问题,但我不知道我会在哪里找到它。不幸的是,谷歌没有太多。
--POST--
在这些测试失败和其他常规测试失败之间,我注意到的一件事是,常规测试失败总是*.out
用脚本的失败输出填充文件。即使我明确输出文本,失败的--POST--
测试文件中也没有任何内容。*.out
这些示例 PHPT 测试是否--POST_RAW--
适用于其他任何人?
这是我的系统规格:(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