Neos\FluidAdaptor\Tests\Unit\View\TemplatePathsTest::getTemplateSourceChecksDifferentPathPatternsAndReturnsTheFirstPathWhichExists PHP Метод

getTemplateSourceChecksDifferentPathPatternsAndReturnsTheFirstPathWhichExists() публичный Метод

    public function getTemplateSourceChecksDifferentPathPatternsAndReturnsTheFirstPathWhichExists()
    {
        vfsStreamWrapper::register();
        mkdir('vfs://MyTemplates');
        file_put_contents('vfs://MyTemplates/MyCoolAction.html', 'contentsOfMyCoolAction');
        $paths = ['vfs://NonExistentDir/UnknownFile.html', 'vfs://MyTemplates/@action.html', 'vfs://MyTemplates/MyCoolAction.html'];
        $templatePaths = $this->getAccessibleMock(TemplatePaths::class, ['expandGenericPathPattern'], [['templatePathAndFilenamePattern' => '@templateRoot/@subpackage/@controller/@action.@format']], '', true);
        $templatePaths->expects($this->once())->method('expandGenericPathPattern')->with('@templateRoot/@subpackage/@controller/@action.@format', ['controllerName' => '', 'action' => 'MyCoolAction', 'format' => 'html'], false, false)->will($this->returnValue($paths));
        $this->assertSame('contentsOfMyCoolAction', $templatePaths->getTemplateSource('', 'myCoolAction'));
    }