Exemplo n.º 1
0
 public function testUpdatePassword()
 {
     $admin = AdminQuery::create()->findOne();
     $adminEvent = new AdministratorUpdatePasswordEvent($admin);
     $adminEvent->setPassword('toto')->setDispatcher($this->getMock("Symfony\\Component\\EventDispatcher\\EventDispatcherInterface"));
     $actionAdmin = new Administrator();
     $actionAdmin->updatePassword($adminEvent);
     $updatedAdmin = $adminEvent->getAdmin();
     $this->assertInstanceOf("Thelia\\Model\\Admin", $updatedAdmin);
     $this->assertTrue(password_verify($adminEvent->getPassword(), $updatedAdmin->getPassword()));
 }
Exemplo n.º 2
0
 public function testUpdatePassword()
 {
     $admin = AdminQuery::create()->findOne();
     $adminEvent = new AdministratorUpdatePasswordEvent($admin);
     $adminEvent->setPassword('toto');
     $actionAdmin = new Administrator($this->mailerFactory, $this->tokenProvider);
     $actionAdmin->updatePassword($adminEvent);
     $updatedAdmin = $adminEvent->getAdmin();
     $this->assertInstanceOf("Thelia\\Model\\Admin", $updatedAdmin);
     $this->assertTrue(password_verify($adminEvent->getPassword(), $updatedAdmin->getPassword()));
 }