model = Bootstrap::getObjectManager()->create(\Magento\Framework\Filesystem\FileResolver::class); $this->originalPath = get_include_path(); set_include_path('/pre/existing/paths/'); } public function tearDown() { set_include_path($this->originalPath); } public function testAddIncludePathPrepend() { $this->model->addIncludePath(self::FIRST_PATH); $this->model->addIncludePath(self::SECOND_PATH); $postIncludePath = get_include_path(); $this->assertStringStartsWith( self::SECOND_PATH, $postIncludePath ); } public function testAddIncludePathAppend() { $this->model->addIncludePath(self::FIRST_PATH, false); $this->model->addIncludePath(self::SECOND_PATH, false); $postIncludePath = get_include_path(); $this->assertStringEndsWith( self::SECOND_PATH, $postIncludePath ); } public function testGetFile() { $includePath = realpath(__DIR__ . '/_files/'); $className = '\ClassToFind'; $this->model->addIncludePath($includePath); $this->assertFileExists($this->model->getFile($className)); } }