Contao\CoreBundle\Test\Framework\ContaoFrameworkTest::testErrorLevelOverride PHP Method

testErrorLevelOverride() public method

Tests that the error level will get updated when configured.
    public function testErrorLevelOverride()
    {
        $request = new Request();
        $request->attributes->set('_route', 'dummy');
        $request->attributes->set('_contao_referer_id', 'foobar');
        $container = $this->mockContainerWithContaoScopes(ContaoCoreBundle::SCOPE_BACKEND);
        $container->get('request_stack')->push($request);
        $framework = $this->mockContaoFramework($container->get('request_stack'), $this->mockRouter('/contao/install'));
        $framework->setContainer($container);
        $errorReporting = error_reporting();
        error_reporting(E_ALL ^ E_USER_NOTICE);
        $this->assertNotEquals($errorReporting, error_reporting(), 'Test is invalid, error level has not changed.');
        $framework->initialize();
        $this->assertEquals($errorReporting, error_reporting());
        error_reporting($errorReporting);
    }