Esempio n. 1
0
 /**
  * Test expires limitation
  */
 public function testLimitExpires()
 {
     $testCredentials = $this->credentials;
     $testCredentials['expires'] = 0;
     $credentials = $this->credentialsService->save($testCredentials);
     $this->assertNotSame($credentials->getExpires(), $testCredentials['expires'] + time());
     $this->credentialsService->delete($credentials->getHash());
 }
Esempio n. 2
0
 /**
  * Test credential viewing
  */
 public function testViewCredentials()
 {
     $credentials = $this->credentialsService->save($this->credentials);
     $client = $this->createClient();
     $crawler = $client->request('GET', '/pw/' . $credentials->getHash());
     $this->assertTrue($client->getResponse()->isOk());
     $this->assertEquals($this->credentials['userName'], $crawler->filter('#userName > span')->text());
     $this->assertEquals($this->credentials['password'], $crawler->filter('#password > span')->text());
     $this->assertEquals($this->credentials['comment'], trim($crawler->filter('#comment')->text()));
     $this->credentialsService->delete($credentials->getHash());
 }