AssertIncluded   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A assertResponseContainsInclude() 0 6 1
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