Contao\CoreBundle\Test\Cache\ContaoCacheWarmerTest::testIncompleteInstallation PHP Method

testIncompleteInstallation() public method

Tests that no cache is created if the installation is incomplete.
    public function testIncompleteInstallation()
    {
        /** @var Connection|\PHPUnit_Framework_MockObject_MockObject $connection */
        $connection = $this->getMock('Doctrine\\DBAL\\Connection', ['query'], [], '', false);
        $connection->expects($this->any())->method('query')->willThrowException(new \Exception());
        $framework = $this->getMockBuilder('Contao\\CoreBundle\\Framework\\ContaoFramework')->setMethods(['initialize'])->disableOriginalConstructor()->getMock();
        $framework->expects($this->never())->method('initialize');
        $warmer = new ContaoCacheWarmer(new Filesystem(), new ResourceFinder($this->getRootDir() . '/vendor/contao/test-bundle/Resources/contao'), new FileLocator($this->getRootDir() . '/vendor/contao/test-bundle/Resources/contao'), $this->getRootDir() . '/vendor/contao/test-bundle/Resources/contao', $connection, $framework);
        $warmer->warmUp($this->getCacheDir());
        $this->assertFileNotExists($this->getCacheDir() . '/contao');
    }