Completed
Push — master ( 75ca6a...d59674 )
by Владислав
02:12
created

TwoCaptchaTest::testRecognizeBalanceError2()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 0
1
<?php
2
3
/**
4
 * Class TwoCaptchaTest.
5
 */
6
class TwoCaptchaTest extends PHPUnit_Framework_TestCase
1 ignored issue
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
{
8
    /**
9
     * @expectedException \jumper423\decaptcha\core\DeCaptchaErrors
10
     * @expectedExceptionMessage Нулевой либо отрицательный баланс
11
     * @expectedExceptionCode 3
12
     */
13
    public function testRecognizeBalanceError1()
14
    {
15
        $captcha = new \jumper423\decaptcha\services\TwoCaptcha([
16
            \jumper423\decaptcha\services\TwoCaptcha::PARAM_SPEC_API_KEY => '200a1ed2b6ca001d8171c655658086ed',
17
        ]);
18
        $captcha->setErrorLang(\jumper423\decaptcha\core\DeCaptchaErrors::LANG_RU);
19
        $captcha->setCauseAnError(true);
20
        $captcha->recognize(__DIR__ . '/data/Captcha.jpg');
21
    }
22
23
    public function testRecognizeBalanceError2()
24
    {
25
        $captcha = new \jumper423\decaptcha\services\TwoCaptcha([
26
            \jumper423\decaptcha\services\TwoCaptcha::PARAM_SPEC_API_KEY => '200a1ed2b6ca001d8171c655658086ed',
27
        ]);
28
        $captcha->setErrorLang(\jumper423\decaptcha\core\DeCaptchaErrors::LANG_RU);
29
        if ($captcha->recognize(__DIR__ . '/data/Captcha.jpg')) {
30
            $this->assertEquals('11111111111111', $captcha->getCode());
31
        } else {
32
            $this->assertEquals('Нулевой либо отрицательный баланс', $captcha->getError());
33
        }
34
    }
35
}
36