Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Test Failed
Push — add-tests ( b5d574...b02a3b )
by Pedro
11:16
created

testSaveReorderTree()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 37
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 24
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 37
rs 9.536
1
<?php
2
3
namespace Backpack\CRUD\Tests\Unit\CrudPanel;
4
5
use Backpack\CRUD\Tests\config\CrudPanel\BaseDBCrudPanel;
6
use Illuminate\Support\Facades\DB;
7
use Backpack\CRUD\Tests\config\Models\Reorder;
8
9
/**
10
 * @covers Backpack\CRUD\app\Library\CrudPanel\Traits\Reorder
11
 */
12
class CrudPanelReorderOperationTest extends BaseDBCrudPanel
13
{   
14
    public function testSaveReorderTree()
15
    {
16
        $this->createReorderItems();
17
        $this->crudPanel->setModel(Reorder::class);
18
19
        $this->crudPanel->updateTreeOrder(
20
            [
21
                [
22
                    'item_id' => 1,
23
                    'parent_id' => null,
24
                    'depth' => 1,
25
                    'left' => 2,
26
                    'right' => 7,
27
                ],
28
                [
29
                    'item_id' => 2,
30
                    'parent_id' => 1,
31
                    'depth' => 2,
32
                    'left' => 3,
33
                    'right' => 4,
34
                ],
35
                [
36
                    'item_id' => 3,
37
                    'parent_id' => 1,
38
                    'depth' => 2,
39
                    'left' => 5,
40
                    'right' => 6,
41
                ],
42
            ]
43
        );
44
45
        $this->assertDatabaseHas('reorders', [
46
            'id' => 1,
47
            'parent_id' => null,
48
            'lft' => 2,
49
            'rgt' => 7,
50
            'depth' => 1,
51
        ]);
52
        
53
    }
54
55
    private function createReorderItems()
56
    {
57
        DB::table('reorders')->insert([
58
            [
59
                'id' => 1,
60
                'name' => 'Item 1',
61
                'parent_id' => null,
62
                'lft' => null,
63
                'rgt' => null,
64
                'depth' => null,
65
            ],
66
            [
67
                'id' => 2,
68
                'name' => 'Item 2',
69
                'parent_id' => null,
70
                'lft' => null,
71
                'rgt' => null,
72
                'depth' => null,
73
            ],
74
            [
75
                'id' => 3,
76
                'name' => 'Item 3',
77
                'parent_id' => null,
78
                'lft' => null,
79
                'rgt' => null,
80
                'depth' => null,
81
            ],
82
        ]);
83
    }
84
}
85