/** * testing ExpenseTypeShow action. */ public function testExpenseTypeShowAction() { // Existing per diem. $crawler = $this->client->request('POST', '/secured/admin/travelexpensetype/show/' . $this->expenseType->getId()); $this->assertTrue($this->client->getResponse()->headers->contains('Content-Type', 'text/html; charset=UTF-8'), 'testExpenseTypeShowAction: The content-type is not html.'); // New expense type $crawler = $this->client->request('POST', '/secured/admin/travelexpensetype/show/new'); $this->assertTrue($this->client->getResponse()->headers->contains('Content-Type', 'text/html; charset=UTF-8'), 'testExpenseTypeShowAction: The content-type is not html.'); }
/** * {@inheritDoc} */ public function doLoad(ObjectManager $manager) { $expenseTypes = array('Tickets', 'Taxi', 'Hotel', 'Exchange cost', 'Other'); foreach ($expenseTypes as $type) { $expenseType = new TEExpenseType(); $expenseType->setName($type); $manager->persist($expenseType); $this->addReference('expense-type-' . strtolower(str_replace(' ', '-', $type)), $expenseType); } $manager->flush(); }