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

AssertJsonapi::assertJsonapiObjectEquals()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
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