Hostnet\Component\Webpack\Asset\CacheGuardTest::testCacheOutdated PHP Method

testCacheOutdated() public method

Simple test for the case the cache is outdated.
public testCacheOutdated ( )
    public function testCacheOutdated()
    {
        $compiler = $this->prophesize(Compiler::class);
        $compiler->compile()->willReturn('some debug output');
        $dumper = $this->prophesize(Dumper::class);
        $dumper->dump()->shouldBeCalled();
        //Cache is outdated.
        $tracker = $this->prophesize(Tracker::class);
        $tracker->isOutdated()->willReturn(true);
        //What do we expect for logging
        $logger = $this->prophesize(LoggerInterface::class);
        $logger->info('[Webpack 1/2]: Compiling assets.')->shouldBeCalled();
        $logger->info('[Webpack 2/2]: Dumping assets.')->shouldBeCalled();
        $logger->debug('some debug output')->shouldBeCalled();
        $cache_guard = new CacheGuard($compiler->reveal(), $dumper->reveal(), $tracker->reveal(), $logger->reveal());
        $cache_guard->rebuild();
    }