RestBundle\Tests\Controller\RestControllerTest::testGetComment PHP Method

testGetComment() public method

public testGetComment ( )
    public function testGetComment()
    {
        $post = $this->getExamplePostEntity();
        $comment = $this->getExampleCommentEntity();
        $comment->setPost($post);
        $this->entityManager->persist($post);
        $this->entityManager->persist($comment);
        $this->entityManager->flush();
        $client = static::createClient();
        $client->request('GET', '/api/v1/comments/' . $comment->getId() . '.json');
        $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());
        $commentResponse = json_decode($client->getResponse()->getContent(), true);
        $this->assertEquals($comment->getContent(), $commentResponse['content']);
        $this->entityManager->remove($post);
        $this->entityManager->flush();
    }