Passed
Branch develop (84afed)
by Paulius
02:35
created

QueryValidatorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 9
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetResponseData() 0 14 1
1
<?php
2
namespace Dokobit\Gateway\Tests\Exception;
3
4
use Dokobit\Gateway\Exception\QueryValidator;
5
use Symfony\Component\Validator\ConstraintViolationList;
6
7
use PHPUnit\Framework\TestCase;
8
9
class QueryValidatorTest extends TestCase
10
{
11
    public function testGetResponseData()
12
    {
13
        $message = 'Message';
14
        $violations = $this->getMockBuilder('Symfony\Component\Validator\ConstraintViolationList')
15
            ->disableOriginalConstructor()
16
            ->getMock()
17
        ;
18
19
        $violations->method('__toString')->willReturn('list of violations');
20
21
        $object = new QueryValidator($message, $violations);
22
23
        $this->assertEquals($violations, $object->getViolations());
24
        $this->assertEquals($message . ': list of violations', $object->getMessage());
25
    }
26
}
27