Networking\InitCmsBundle\Tests\EventListener\LocaleListenerTest::testOnKernelRequest_WithNoRequest_ShouldDoNothing PHP Метод

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

    public function testOnKernelRequest_WithNoRequest_ShouldDoNothing()
    {
        $event = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent')->disableOriginalConstructor()->getMock();
        $event->expects($this->once())->method('getRequest')->will($this->returnValue(null));
        $accessMapStub = $this->getMock('\\Symfony\\Component\\Security\\Http\\AccessMap');
        $accessMapStub->expects($this->never())->method('getPatterns')->will($this->returnValue(array(array('hallo'))));
        $listener = new LocaleListener($accessMapStub, array(array('locale' => 'de')), 'en');
        $voidResult = $listener->onKernelRequest($event);
        $this->assertNull($voidResult);
    }