Neos\Fusion\Tests\Functional\TypoScriptObjects\ContentCacheTest::maximumLifetimeForCachedSegmentWillBeMinimumOfNestedEmbedSegmentsAndSelf PHP Метод

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

    public function maximumLifetimeForCachedSegmentWillBeMinimumOfNestedEmbedSegmentsAndSelf()
    {
        $view = $this->buildView();
        $view->setOption('enableContentCache', true);
        $view->setTypoScriptPath('contentCache/maximumLifetimeInNestedEmbedAndCachedSegments');
        $mockCache = $this->createMock(\Neos\Cache\Frontend\FrontendInterface::class);
        $this->inject($this->contentCache, 'cache', $mockCache);
        $mockCache->expects($this->any())->method('get')->will($this->returnValue(false));
        $mockCache->expects($this->any())->method('has')->will($this->returnValue(false));
        $entriesWritten = array();
        $mockCache->expects($this->atLeastOnce())->method('set')->will($this->returnCallback(function ($entryIdentifier, $data, $tags, $lifetime) use(&$entriesWritten) {
            $entriesWritten[$entryIdentifier] = array('lifetime' => $lifetime);
        }));
        $firstRenderResult = $view->render();
        $this->assertEquals('Foo|Bar|Baz', $firstRenderResult);
        $this->assertCount(3, $entriesWritten);
        $this->assertEquals(array('7075cb501854d7d8b25926b8c7f79c3e' => array('lifetime' => 60), '007836f2658952a45cfd706c300e208f' => array('lifetime' => null), 'a604a8f56ba95f256b3df4769b42bc6a' => array('lifetime' => 5)), $entriesWritten);
    }