Passed
Pull Request — master (#59)
by Raúl
04:00
created

WrongStatusExceptionTest::testConstructor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Tests\Pagantis\ModuleUtils;
4
5
use Pagantis\ModuleUtils\Exception\WrongStatusException;
6
7
/**
8
 * Class WrongStatusException
9
 *
10
 * @package Pagantis\ModuleUtils\Exception
11
 */
12
class WrongStatusExceptionTest extends AbstractExceptionTest
13
{
14
    /**
15
     * ERROR_MESSAGE
16
     */
17
    const ERROR_MESSAGE = 'Order status is not authorized. Current status: %s';
18
19
    /**
20
     * ERROR_CODE
21
     */
22
    const ERROR_CODE = 403;
23
24
    /**
25
     * ERROR_STATUS
26
     */
27
    const ERROR_STATUS = 'UNCONFIRMED';
28
29
    /**
30
     * testConstructor
31
     */
32
    public function testConstructor()
33
    {
34
        $exception = new WrongStatusException(self::ERROR_STATUS);
35
        $message = sprintf(self::ERROR_MESSAGE, self::ERROR_STATUS);
36
        $this->assertEquals($message, $exception->getMessage());
37
        $this->assertEquals(self::ERROR_CODE, $exception->getCode());
38
    }
39
40
    /**
41
     * testConstant
42
     */
43
    public function testConstant()
44
    {
45
        $this->assertEquals(self::ERROR_MESSAGE, WrongStatusException::ERROR_MESSAGE);
46
        $this->assertEquals(self::ERROR_CODE, WrongStatusException::ERROR_CODE);
47
    }
48
}
49