Bolt\Tests\Controller\Async\GeneralTest::testOmnisearch PHP Method

testOmnisearch() public method

public testOmnisearch ( )
    public function testOmnisearch()
    {
        $this->setRequest(Request::create('/async/omnisearch', 'GET', ['q' => 'sho']));
        $response = $this->controller()->omnisearch($this->getRequest());
        $this->assertTrue($response instanceof JsonResponse);
        $this->assertSame(Response::HTTP_OK, $response->getStatusCode());
        $json = json_decode($response->getContent());
        $this->assertSame('Omnisearch', $json[0]->label);
        $this->assertSame('New Showcase', $json[1]->label);
        $this->assertSame('View Showcases', $json[2]->label);
    }