Beispiel #1
0
 public function testDelete()
 {
     $admin = AdminQuery::create()->findOne();
     $adminEvent = new AdministratorEvent();
     $adminEvent->setId($admin->getId())->setDispatcher($this->getMock("Symfony\\Component\\EventDispatcher\\EventDispatcherInterface"));
     $actionAdmin = new Administrator();
     $actionAdmin->delete($adminEvent);
     $deletedAdmin = $adminEvent->getAdministrator();
     $this->assertInstanceOf("Thelia\\Model\\Admin", $deletedAdmin);
     $this->assertTrue($deletedAdmin->isDeleted());
 }
 protected function getDeleteEvent()
 {
     $event = new AdministratorEvent();
     $event->setId($this->getRequest()->get('administrator_id', 0));
     return $event;
 }
 public function testDelete()
 {
     $admin = AdminQuery::create()->findOne();
     $adminEvent = new AdministratorEvent();
     $adminEvent->setId($admin->getId());
     $actionAdmin = new Administrator($this->mailerFactory, $this->tokenProvider);
     $actionAdmin->delete($adminEvent);
     $deletedAdmin = $adminEvent->getAdministrator();
     $this->assertInstanceOf("Thelia\\Model\\Admin", $deletedAdmin);
     $this->assertTrue($deletedAdmin->isDeleted());
 }