mirror of
https://github.com/adlawson/php-vfs.git
synced 2024-11-24 13:47:42 +00:00
ecbce78baf
Better supports `scheme:///path` and `scheme:///`.
34 lines
761 B
PHP
34 lines
761 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";
|
|
}
|
|
}
|