Passed
Push — master ( 71cd79...3a5308 )
by Vincent
02:53 queued 20s
created

InvalidArgumentHelperTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A invalidArgumentHelper() 0 17 1
1
<?php
2
namespace VGirol\JsonApiAssert\Tests\Exceptions;
3
4
use VGirol\JsonApiAssert\InvalidArgumentException;
5
use VGirol\JsonApiAssert\InvalidArgumentHelper;
6
use VGirol\JsonApiAssert\Tests\TestCase;
7
8
class InvalidArgumentHelperTest extends TestCase
9
{
10
    /**
11
     * @test
12
     */
13
    public function invalidArgumentHelper()
14
    {
15
        $arg = 3;
16
        $type = 'string';
17
        $value = 666;
18
        $expected = \sprintf(
19
            InvalidArgumentException::MESSAGE,
20
            $arg,
21
            ' (' . \gettype($value) . '#' . $value . ')',
22
            'VGirol\JsonApiAssert\Tests\Exceptions\InvalidArgumentHelperTest',
23
            'invalidArgumentHelper',
24
            $type
25
        );
26
27
        $e = InvalidArgumentHelper::factory($arg, $type, $value);
28
29
        $this->assertEquals($expected, $e->getMessage());
30
    }
31
}
32