Contao\CoreBundle\Test\Controller\InsertTagsControllerTest::mockFramework PHP Method

mockFramework() private method

Returns a ContaoFramework instance.
private mockFramework ( Adapter $adapter ) : ContaoFramework
$adapter Contao\CoreBundle\Framework\Adapter
return Contao\CoreBundle\Framework\ContaoFramework The object instance
    private function mockFramework($adapter)
    {
        $container = $this->mockContainerWithContaoScopes();
        /** @var ContaoFramework|\PHPUnit_Framework_MockObject_MockObject $framework */
        $framework = $this->getMockBuilder('Contao\\CoreBundle\\Framework\\ContaoFramework')->setConstructorArgs([$container->get('request_stack'), $this->mockRouter('/index.html'), $this->mockSession(), $this->getRootDir() . '/app', error_reporting()])->setMethods(['initialize', 'createInstance'])->getMock();
        $framework->expects($this->once())->method('initialize');
        $framework->expects($this->any())->method('createInstance')->willReturn($adapter);
        $framework->setContainer($container);
        return $framework;
    }