インストールPEARにPEARのパスを含めると続く。その後セットアップが<a href="http://www.phpunit.de/manual/current/en/installation.html" rel="nofollow">http://www.phpunit.de/manual/current/en/installation.html</a>上方向WAMPを
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit.
を、私はテストを作成しました:
<?php
# error reporting
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
# include TestRunner
require_once 'PHPUnit/TextUI/TestRunner.php';
# our test class
class ExampleTest extends PHPUnit_Framework_TestCase
{
public function testOne()
{
$this->assertTrue(FALSE);
}
}
# run the test
$suite = new PHPUnit_Framework_TestSuite('ExampleTest');
PHPUnit_TextUI_TestRunner::run($suite);
?>
は私が含まphp.iniファイルに以下のとApacheの再起動:
include_path = ".;C:\Program Files/wamp/bin/php/php5.3.8"
include_path = ".;C:\Program Files/wamp/bin/php/php5.3.8/pear"
include_path = ".;C:\Program Files/wamp/bin/php/php5.3.8/pear/PHPUnit"
私はWarning: require_once(PHPUnit/TextUI/TestRunner.php) [function.require-once]: failed to open stream: No such file or directory in ...
インクルードパスが機能しないのはなぜですか? Program files
にスペースがあるからでしょうか?
Windows XPとWAMPで作業しています。
EDIT:提案通りにパスを更新しました。
のrequire_onceコールの前echo ini_get('include_path');
の出力がされています。また、require_onceをコマンドを削除すると、最後の1がすべてを上書きします、iniファイルにこれらの3つの行を追加することによりFatal error: Class 'PHPUnit_Framework_TestCase' not found in...
あなたは正確にあなたのrequire_onceの前にパスを含める 'のPHPUnit/TextUIの/ TestRunner.php' を印刷することができますか? エコーini_get( 'include_path');おそらく何かがそれを上書きしています –
のサイドノートPHPUnitのファイルをテストケースに手動で入れる必要はありません。コマンドラインからPHPUnitを実行すると、独自のオートローダーが登録されます。 PEARがinclude_pathにあることを確認する必要があります。 – Gordon
実際に、私はそれらの「How Do I」の投稿に相談しました。彼らはインストールのための多くの異なる指示を持っていますが、問題を解決しませんでした。 –