FluidTYPO3\Fluidpages\Tests\Unit\Service\ConfigurationServiceTest::testConvertFileReferenceToTemplatePathAndFilename PHP Метод

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

public testConvertFileReferenceToTemplatePathAndFilename ( string $reference, string | null $resourceFactoryOutput, string $expected ) : void
$reference string
$resourceFactoryOutput string | null
$expected string
Результат void
    public function testConvertFileReferenceToTemplatePathAndFilename($reference, $resourceFactoryOutput, $expected)
    {
        $instance = new ConfigurationService();
        if (null !== $resourceFactoryOutput) {
            /** @var ResourceFactory|\PHPUnit_Framework_MockObject_MockObject $resourceFactory */
            $resourceFactory = $this->getMock('TYPO3\\CMS\\Core\\Resource\\ResourceFactory', array('getFileObjectFromCombinedIdentifier'));
            $resourceFactory->expects($this->once())->method('getFileObjectFromCombinedIdentifier')->with($reference)->willReturn($resourceFactoryOutput);
            $instance->injectResourceFactory($resourceFactory);
        }
        $result = $instance->convertFileReferenceToTemplatePathAndFilename($reference);
        $this->assertEquals($expected, $result);
    }