@@ 10-21 (lines=12) @@ | ||
7 | */ |
|
8 | class AnticaptchaTest extends PHPUnit_Framework_TestCase |
|
9 | { |
|
10 | public function testRecognize() |
|
11 | { |
|
12 | $captcha = new Anticaptcha([ |
|
13 | \jumper423\decaptcha\services\Anticaptcha::ACTION_FIELD_KEY => '5464654645646', |
|
14 | ]); |
|
15 | $captcha->setErrorLang(\jumper423\decaptcha\core\DeCaptchaErrors::LANG_RU); |
|
16 | if ($captcha->recognize(__DIR__.'/data/Captcha.jpg')) { |
|
17 | $this->assertEquals('11111111111111', $captcha->getCode()); |
|
18 | } else { |
|
19 | $this->assertEquals('Использован несуществующий key', $captcha->getError()); |
|
20 | } |
|
21 | } |
|
22 | ||
23 | public function testEnum() |
|
24 | { |
|
@@ 23-35 (lines=13) @@ | ||
20 | } |
|
21 | } |
|
22 | ||
23 | public function testEnum() |
|
24 | { |
|
25 | $captcha = new \jumper423\decaptcha\services\Anticaptcha([ |
|
26 | \jumper423\decaptcha\services\Anticaptcha::ACTION_FIELD_KEY => '5464654645646', |
|
27 | \jumper423\decaptcha\services\Anticaptcha::ACTION_FIELD_LANGUAGE => 'ru', |
|
28 | ]); |
|
29 | $captcha->setErrorLang(\jumper423\decaptcha\core\DeCaptchaErrors::LANG_RU); |
|
30 | if ($captcha->recognize(__DIR__.'/data/Captcha.jpg')) { |
|
31 | $this->assertEquals('11111111111111', $captcha->getCode()); |
|
32 | } else { |
|
33 | $this->assertEquals('Нет в допустимых значениях поля: languagePool = ru', $captcha->getError()); |
|
34 | } |
|
35 | } |
|
36 | } |
|
37 |