AssertIncluded::assertResponseContainsInclude()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace VGirol\JsonApiAssert\Laravel\Asserts\Content;
4
5
use Illuminate\Testing\TestResponse;
6
7
/**
8
 * This trait adds the ability to test included collection.
9
 */
10
trait AssertIncluded
11
{
12
    /**
13
     * Asserts that an include object contains an expected collection.
14
     *
15
     * @param TestResponse $response
16
     * @param array        $expected
17
     *
18
     * @return void
19
     * @throws \PHPUnit\Framework\AssertionFailedError
20
     */
21
    public static function assertResponseContainsInclude(TestResponse $response, $expected)
22
    {
23
        // Decode JSON response
24
        $json = $response->json();
25
26
        static::assertDocumentContainsInclude($expected, $json);
27
    }
28
}
29