Bolt\Tests\Controller\FrontendTest::testRecord PHP Method

testRecord() public method

public testRecord ( )
    public function testRecord()
    {
        $contentType = $this->getService('storage')->getContentType('pages');
        $request = Request::create('/pages/test');
        $this->setRequest($request);
        $content = new Content($this->getApp(), $contentType);
        $content->setValues(['slug' => 'test', 'title' => 'test']);
        $this->getService('storage')->saveContent($content);
        $response = $this->controller()->record($request, 'pages', 'test');
        $this->assertTrue($response instanceof TemplateResponse);
        $this->assertSame('page.twig', $response->getTemplate()->getTemplateName());
        $this->assertNotEmpty($response->getGlobals());
    }