Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Avoid multiple calls to getService()
Browse files Browse the repository at this point in the history
  • Loading branch information
akrabat committed Feb 22, 2017
1 parent 98cb25b commit 7594b57
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/ReCaptchaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ public function testValidationForDifferentElementName()
'site_key' => getenv('TESTS_ZEND_SERVICE_RECAPTCHA_SITE_KEY'),
'secret_key' => getenv('TESTS_ZEND_SERVICE_RECAPTCHA_SECRET_KEY'),
]);
$captcha->getService()->setIp('127.0.0.1');
$captcha->getService()->setHttpClient($this->getHttpClient());
$service = $captcha->getService();
$service->setIp('127.0.0.1');
$service->setHttpClient($this->getHttpClient());

$response = getenv('TESTS_ZEND_SERVICE_RECAPTCHA_RESPONSE');
$value = 'g-recaptcha-response';
Expand All @@ -180,8 +181,9 @@ public function testValidationForResponseElementName()
'site_key' => getenv('TESTS_ZEND_SERVICE_RECAPTCHA_SITE_KEY'),
'secret_key' => getenv('TESTS_ZEND_SERVICE_RECAPTCHA_SECRET_KEY'),
]);
$captcha->getService()->setIp('127.0.0.1');
$captcha->getService()->setHttpClient($this->getHttpClient());
$service = $captcha->getService();
$service->setIp('127.0.0.1');
$service->setHttpClient($this->getHttpClient());

$response = getenv('TESTS_ZEND_SERVICE_RECAPTCHA_RESPONSE');
$value = getenv('TESTS_ZEND_SERVICE_RECAPTCHA_RESPONSE');
Expand Down

0 comments on commit 7594b57

Please sign in to comment.