Ojs\JournalBundle\Tests\Controller\BlockControllerTest::testDelete PHP Метод

testDelete() публичный Метод

public testDelete ( )
    public function testDelete()
    {
        $em = $this->em;
        $entity = new Block();
        $entity->setCurrentLocale('en');
        $entity->setTitle('Block');
        $entity->setBlockOrder(1);
        $entity->setColor('success');
        $journal = $em->getRepository('OjsJournalBundle:Journal')->find('1');
        $entity->setJournal($journal);
        $em->persist($entity);
        $em->flush();
        $id = $entity->getId();
        $this->logIn();
        $client = $this->client;
        $token = $this->generateToken('ojs_journal_block' . $id);
        $client->request('DELETE', '/journal/1/block/' . $id . '/delete', array('_token' => $token));
        $this->assertStatusCode(302, $client);
    }