Neos\Flow\Tests\Unit\Configuration\ConfigurationManagerTest::loadConfigurationCacheLoadsConfigurationsFromCacheIfACacheFileExists PHP Метод

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

    public function loadConfigurationCacheLoadsConfigurationsFromCacheIfACacheFileExists()
    {
        vfsStream::setup('Flow/Cache');
        $configurationsCode = <<<EOD
<?php
return array('bar' => 'touched');
?>
EOD;
        $cachedConfigurationsPathAndFilename = vfsStream::url('Flow/Cache/Configurations.php');
        file_put_contents($cachedConfigurationsPathAndFilename, $configurationsCode);
        $configurationManager = $this->getAccessibleMock(ConfigurationManager::class, ['postProcessConfiguration', 'constructConfigurationCachePath'], [], '', false);
        $configurationManager->expects($this->any())->method('constructConfigurationCachePath')->willReturn('notfound.php', $cachedConfigurationsPathAndFilename);
        $configurationManager->_set('configurations', ['foo' => 'untouched']);
        $configurationManager->_call('loadConfigurationCache');
        $this->assertSame(['foo' => 'untouched'], $configurationManager->_get('configurations'));
        $configurationManager->_call('loadConfigurationCache');
        $this->assertSame(['bar' => 'touched'], $configurationManager->_get('configurations'));
    }
ConfigurationManagerTest