3 * This file is part of vfsStream.
5 * For the full copyright and license information, please view the LICENSE
6 * file that was distributed with this source code.
8 * @package org\bovigo\vfs
10 namespace org\bovigo\vfs;
12 * Test for org\bovigo\vfs\vfsStream.
17 class vfsStreamResolveIncludePathTestCase extends \PHPUnit_Framework_TestCase
20 * include path to restore after test run
24 protected $backupIncludePath;
27 * set up test environment
29 public function setUp()
31 $this->backupIncludePath = get_include_path();
33 mkdir('vfs://root/a/path', 0777, true);
34 set_include_path('vfs://root/a' . PATH_SEPARATOR . $this->backupIncludePath);
38 * clean up test environment
40 public function tearDown()
42 set_include_path($this->backupIncludePath);
48 public function knownFileCanBeResolved()
50 file_put_contents('vfs://root/a/path/knownFile.php', '<?php ?>');
51 $this->assertEquals('vfs://root/a/path/knownFile.php', stream_resolve_include_path('path/knownFile.php'));
57 public function unknownFileCanNotBeResolvedYieldsFalse()
59 $this->assertFalse(@stream_resolve_include_path('path/unknownFile.php'));