Completed
Push — master ( dcb8b5...4e6023 )
by Владислав
01:56
created

DeCaptchaErrorsTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 42
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testErrorNoSuchMethod() 0 4 1
A testErrorTooBigCaptchaFilesize() 0 4 1
A testNotConfig() 0 4 1
A testNotConfigNumber() 0 4 1
1
<?php
2
3
use \jumper423\decaptcha\core\DeCaptchaErrors;
4
5
class DeCaptchaErrorsTest 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...
6
{
7
    /**
8
     * @expectedException \jumper423\decaptcha\core\DeCaptchaErrors
9
     * @expectedExceptionMessage Вы должны слать параметр method в вашем запросе к API, изучите документацию
10
     * @expectedExceptionCode 7
11
     */
12
    public function testErrorNoSuchMethod()
13
    {
14
        throw new DeCaptchaErrors('ERROR_NO_SUCH_METHOD', null, DeCaptchaErrors::LANG_RU);
15
    }
16
17
    /**
18
     * @expectedException \jumper423\decaptcha\core\DeCaptchaErrors
19
     * @expectedExceptionMessage Ваша капча имеет размер более 100 килобайт: вес файла 5 МБ
20
     * @expectedExceptionCode 2
21
     */
22
    public function testErrorTooBigCaptchaFilesize()
23
    {
24
        throw new DeCaptchaErrors('ERROR_TOO_BIG_CAPTCHA_FILESIZE', 'вес файла 5 МБ', DeCaptchaErrors::LANG_RU);
25
    }
26
27
    /**
28
     * @expectedException \jumper423\decaptcha\core\DeCaptchaErrors
29
     * @expectedExceptionMessage NOT_CONFIG
30
     * @expectedExceptionCode 0
31
     */
32
    public function testNotConfig()
33
    {
34
        throw new DeCaptchaErrors('NOT_CONFIG');
35
    }
36
37
    /**
38
     * @expectedException \jumper423\decaptcha\core\DeCaptchaErrors
39
     * @expectedExceptionMessage ERROR Code №1555
40
     * @expectedExceptionCode 1555
41
     */
42
    public function testNotConfigNumber()
43
    {
44
        throw new DeCaptchaErrors(1555);
45
    }
46
}