public function testDelete() { $em = $this->em; $institution = new Institution(); $institution->setCurrentLocale($this->locale); $institution->setEmail('*****@*****.**'); $institution->setName('Delete Institution Name - phpunit'); $institution->setUrl('http://ojs.io'); $institution->setAbout('About'); $institution->setPhone('0123456789'); $institution->setAddress('address'); $publisherType = $em->getRepository('OjsJournalBundle:PublisherTypes')->find(1); $institution->setInstitutionType($publisherType); $em->persist($institution); $em->flush(); $id = $institution->getId(); $this->logIn(); $client = $this->client; $token = $this->generateToken('ojs_admin_institution' . $id); $client->request('DELETE', '/admin/institution/' . $id . '/delete', array('_token' => $token)); $this->assertStatusCode(302, $client); }