Bolt\Tests\Controller\FrontendTest::testNumericRecord PHP Метод

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

public testNumericRecord ( )
    public function testNumericRecord()
    {
        $this->setRequest(Request::create('/pages/', 'GET', ['id' => 5]));
        $contentType = $this->getService('storage')->getContentType('pages');
        $content1 = new Content($this->getApp(), $contentType);
        $storage = $this->getMockStorage(['getContent']);
        $storage->expects($this->at(0))->method('getContent')->will($this->returnValue(false));
        $storage->expects($this->at(1))->method('getContent')->will($this->returnValue($content1));
        $this->setService('storage', $storage);
        $response = $this->controller()->record($this->getRequest(), 'pages', 5);
        $this->assertTrue($response instanceof TemplateResponse);
        $this->assertSame('page.twig', $response->getTemplate()->getTemplateName());
        $this->assertNotEmpty($response->getGlobals());
    }