public function testFindWithParameter() { $testEntity = UserPasswordResetTokenTest::createTestPasswordResetToken(); self::$entityManager->persist($testEntity); self::$entityManager->flush(); $entity = UserPasswordResetTokenService::find($testEntity->getId()); $this->assertEquals($testEntity->toArray(), $entity->toArray()); }
public function testLostPasswordActionAsGuestWithUnknownUsername() { $this->dispatch('/user/lostpassword'); // Submit form data $request = $this->getRequest(); $request->setMethod('POST')->setPost(array('username' => 'nosuchuser')); $this->redispatch('/user/lostpassword', false); #$this->assertNotRedirect(); #$this->assertBodyContains('Sorry. We have no record of that email address'); $this->assertRedirectTo('/home', 'Failed to redirect'); $resetTokens = UserPasswordResetTokenService::find(); $this->assertEquals(0, count($resetToken)); }