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

testDelete() public method

public testDelete ( )
    public function testDelete()
    {
        $em = $this->em;
        $articleType = new ArticleTypes();
        $articleType->setCurrentLocale($this->locale);
        $articleType->setName('Delete Article Type Name - phpunit');
        $em->persist($articleType);
        $em->flush();
        $id = $articleType->getId();
        $this->logIn();
        $client = $this->client;
        $token = $this->generateToken('ojs_admin_article_type' . $id);
        $client->request('DELETE', '/admin/article-type/' . $id . '/delete', array('_token' => $token));
        $this->assertStatusCode(302, $client);
    }