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

testDelete() public method

public testDelete ( )
    public function testDelete()
    {
        $em = $this->em;
        $index = new Index();
        $index->setName('Delete Index - phpunit');
        $index->setLogo('logo.png');
        $index->setStatus(true);
        $em->persist($index);
        $em->flush();
        $id = $index->getId();
        $this->logIn();
        $client = $this->client;
        $token = $this->generateToken('ojs_admin_index' . $id);
        $client->request('DELETE', '/admin/index/' . $id . '/delete', array('_token' => $token));
        $this->assertStatusCode(302, $client);
    }