Ojs\AdminBundle\Tests\Controller\AdminPostControllerTest::testDelete PHP Method

testDelete() public method

public testDelete ( )
    public function testDelete()
    {
        $em = $this->em;
        $entity = new AdminPost();
        $entity->setCurrentLocale($this->locale);
        $entity->setTitle('Post Title Delete - phpunit');
        $entity->setContent('content delete phpunit');
        $em->persist($entity);
        $em->flush();
        $id = $entity->getId();
        $this->logIn();
        $client = $this->client;
        $token = $this->generateToken('ojs_admin_post' . $id);
        $client->request('DELETE', '/admin/post/' . $id . '/delete', array('_token' => $token));
        $this->assertStatusCode(302, $client);
    }