From 7594b57f8cb5e34e2b61a54dd9561dc059d29e8f Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Wed, 22 Feb 2017 11:34:01 +0000 Subject: [PATCH] Avoid multiple calls to getService() --- test/ReCaptchaTest.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/ReCaptchaTest.php b/test/ReCaptchaTest.php index 2c80f7e..1bc47c3 100644 --- a/test/ReCaptchaTest.php +++ b/test/ReCaptchaTest.php @@ -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'; @@ -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');