php-vfs/test/acceptance/Stream/StreamWrapper/RequireAcceptanceTest.php
2014-09-06 14:26:22 +01:00

34 lines
758 B
PHP

<?php
namespace Vfs\Stream\StreamWrapper;
use Vfs\Test\AcceptanceTestCase;
/**
* @todo testRequireMissingFile correctly triggers fatal error, not easy to test
*/
class RequireAcceptanceTest extends AcceptanceTestCase
{
protected $tree = [
'foo' => [
'bar.php' => '<?php return "baz";'
]
];
public function testIncludeFile()
{
$this->assertEquals('baz', include "$this->scheme://foo/bar.php");
}
public function testRequireFile()
{
$this->assertEquals('baz', require "$this->scheme://foo/bar.php");
}
public function testIncludeMissingFile()
{
$this->setExpectedException('PHPUnit_Framework_Error_Warning');
include "$this->scheme://bar.php";
}
}