Contao\CoreBundle\Test\Monolog\ContaoTableProcessorTest::testIpOnEmptyRequest PHP Method

testIpOnEmptyRequest() public method

Tests that an IP is added if there is no request.
    public function testIpOnEmptyRequest()
    {
        $requestStack = $this->getMock('Symfony\\Component\\HttpFoundation\\RequestStack');
        $requestStack->expects($this->any())->method('getCurrentRequest')->willReturn(null);
        $processor = $this->createContaoTableProcessor($requestStack);
        /** @var ContaoContext $context */
        $context = $processor(['context' => ['contao' => new ContaoContext(__METHOD__)]])['extra']['contao'];
        $this->assertEquals('127.0.0.1', $context->getIp());
    }