Beispiel #1
0
 /**
  * {@inheritDoc}
  */
 public function incorrectlySolved(CaptchaSolutionInterface $solution)
 {
     if (!$solution instanceof DeathByCaptchaCaptchaSolution) {
         return false;
     }
     $this->httpClient->post('/api/captcha/' . $solution->getCaptchaId() . '/report', ['body' => ['username' => $this->credentials->getUsername(), 'password' => $this->credentials->getPassword()]]);
     return true;
 }
 /**
  * {@inheritDoc}
  */
 protected function setUp()
 {
     $this->credentials = UsernamePasswordCredentials::fromUsernameAndPassword('usr', 'pswd');
     $this->captcha = Base64Captcha::fromString('');
 }
 /**
  * @test
  */
 public function createWithDefaultPreferences()
 {
     $deathByCaptcha = DeathByCaptchaFactory::createWithDefaultPreferences(UsernamePasswordCredentials::fromUsernameAndPassword('foo', 'bar'));
     $this->assertInstanceOf(DeathByCaptchaInterface::class, $deathByCaptcha);
 }
 /**
  * @test
  */
 public function getPassword()
 {
     $this->assertEquals('supersecret', $this->credentials->getPassword());
 }