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

testDelete() public method

public testDelete ( )
    public function testDelete()
    {
        $em = $this->em;
        $entity = new Subject();
        $entity->setCurrentLocale($this->locale);
        $entity->setSubject('Subject - phpunit');
        $entity->setTags('tags, phpunit');
        $em->persist($entity);
        $em->flush();
        $id = $entity->getId();
        $this->logIn();
        $client = $this->client;
        $token = $this->generateToken('ojs_admin_subject' . $id);
        $client->request('DELETE', '/admin/subject/' . $id . '/delete', array('_token' => $token));
        $this->assertStatusCode(302, $client);
    }