Completed
Push — master ( 9a2e94...dbda34 )
by Vincent
05:01 queued 12s
created

AssertJsonapi   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 16
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A assertJsonapiObjectEquals() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VGirol\JsonApiAssert\Asserts\Content;
6
7
use PHPUnit\Framework\Assert as PHPUnit;
8
9
/**
10
 * This trait adds the ability to test jsonapi object content.
11
 */
12
trait AssertJsonapi
13
{
14
    /**
15
     * Asserts that a jsonapi object equals an expected array.
16
     *
17
     * @link https://jsonapi.org/format/#document-jsonapi-object
18
     *
19
     * @param array $expected The expected jsonapi object
20
     * @param array $json     The jsonapi object to test
21
     *
22
     * @return void
23
     * @throws \PHPUnit\Framework\ExpectationFailedException
24
     */
25 6
    public static function assertJsonapiObjectEquals($expected, $json): void
26
    {
27 6
        PHPUnit::assertSame($expected, $json);
28 3
    }
29
}
30