mirror of
https://github.com/adlawson/php-vfs.git
synced 2025-01-24 14:18:27 +00:00
Add require
and include
acceptance tests
This commit is contained in:
parent
c3ac67db8a
commit
b8d8ddf714
@ -0,0 +1,33 @@
|
||||
<?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";
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user