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

BaseDBCrudPanel   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 50
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 14 1
A assertEntryEquals() 0 12 3
1
<?php
2
3
namespace Backpack\CRUD\Tests\Config\CrudPanel;
4
5
use Backpack\CRUD\app\Library\CrudPanel\CrudPanel;
6
use Illuminate\Foundation\Testing\RefreshDatabase;
7
8
abstract class BaseDBCrudPanel extends BaseCrudPanel
9
{
10
    use RefreshDatabase;
0 ignored issues
show
introduced by
The trait Illuminate\Foundation\Testing\RefreshDatabase requires some properties which are not provided by Backpack\CRUD\Tests\Conf...udPanel\BaseDBCrudPanel: $seeder, $seed, $connectionsToTransact, $dropTypes, $dropViews
Loading history...
11
12
    /**
13
     * @var CrudPanel
14
     */
15
    protected $crudPanel;
16
17
    protected $model;
18
19
    /**
20
     * Setup the test environment.
21
     *
22
     * @return void
23
     */
24
    protected function setUp(): void
25
    {
26
        parent::setUp();
27
28
        // call migrations specific to our tests
29
        $this->loadMigrationsFrom([
30
            '--database' => 'testing',
31
            '--path' => realpath(__DIR__.'/../../config/database/migrations'),
32
        ]);
33
34
        $this->seed('Backpack\CRUD\Tests\config\database\seeds\UsersRolesTableSeeder');
35
        $this->seed('Backpack\CRUD\Tests\config\database\seeds\UsersTableSeeder');
36
        $this->seed('Backpack\CRUD\Tests\config\database\seeds\ArticlesTableSeeder');
37
        $this->seed('Backpack\CRUD\Tests\config\database\seeds\MorphableSeeders');
38
    }
39
40
    /**
41
     * Assert that the attributes of a model entry are equal to the expected array of attributes.
42
     *
43
     * @param  array  $expected  attributes
44
     * @param  \Illuminate\Database\Eloquent\Model  $actual  model
45
     */
46
    protected function assertEntryEquals($expected, $actual)
47
    {
48
        foreach ($expected as $key => $value) {
49
            if (is_array($value)) {
50
                $this->assertEquals(count($value), $actual->{$key}->count());
51
            } else {
52
                $this->assertEquals($value, $actual->{$key});
53
            }
54
        }
55
56
        $this->assertNotNull($actual->created_at);
57
        $this->assertNotNull($actual->updated_at);
58
    }
59
}
60