ファイルをインクルードしようとすると、PHPUnit からエラー メッセージが表示されます。たとえば、次のコードではエラーが発生します。
<?php
include_once "PHPUnit/Autoload.php";
require_once "controller/ProductController.php";
class SecurityTests extends PHPUnit_Framework_TestCase
{
public function testSmth() {
$this->assertTrue(1==1);
}
}
?>
しかし、4 行目 ( ) を削除するとrequire_once "controller/ProductController.php";
、問題なく動作します。
私が得るエラーは次のとおりです。
Warning: require_once(PHPUnit/Framework/Error.php): failed to open stream: No such file or directory in E:\wamp\bin\php\php5.4.3\pear\PHPUnit\Util\ErrorHandler.php on line 48
編集: php.ini ファイルの include_path は次のとおりです。
include_path = ".;E:\wamp\bin\php\php5.4.3\pear\;E:\wamp\www\renting\"
奇妙なこと:
<?php
echo get_include_path(); **// Will echo .;E:\wamp\bin\php\php5.4.3\pear\;E:\wamp\www\renting\**
require_once 'PHPUnit/Autoload.php';
require_once 'controller/AccountController.php';
echo get_include_path(); **// Will echo E:/wamp/www/renting/**
また:
<?php
require_once 'controller/AccountController.php';
echo get_include_path(); **// Will echo E:/wamp/www/renting/**
require_once 'PHPUnit/Autoload.php';
echo get_include_path(); **// Will not even echo.**
これは私にとって非常に奇妙です。
何か案は?