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

Passed
Push — bassets ( 438f93...6e306b )
by Cristian
37:11 queued 22:16
created

testItCanSetAndGetTheSubheadingFromTheAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Backpack\CRUD\Tests\Unit\CrudPanel;
4
5
use Backpack\CRUD\Tests\Unit\Models\User;
6
use Illuminate\Routing\Route;
7
8
/**
9
 * @covers Backpack\CRUD\app\Library\CrudPanel\Traits\HeadingsAndTitles
10
 * @covers Backpack\CRUD\app\Library\CrudPanel\CrudPanel
11
 */
12
class CrudPanelTitlesAndHeadingsTest extends BaseDBCrudPanelTest
13
{
14
    public function testItCanSetAndGetTheTitleFromTheAction()
15
    {
16
        $this->crudPanel->setTitle('test', 'create');
17
        $this->assertEquals('test', $this->crudPanel->getTitle('create'));
0 ignored issues
show
Bug introduced by
'create' of type string is incompatible with the type boolean expected by parameter $action of Backpack\CRUD\app\Librar...l\CrudPanel::getTitle(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

17
        $this->assertEquals('test', $this->crudPanel->getTitle(/** @scrutinizer ignore-type */ 'create'));
Loading history...
18
        $this->assertEquals($this->crudPanel->get('create.title'), $this->crudPanel->getTitle('create'));
19
    }
20
21
    public function testItCanSetAndGetTheHeadingFromTheAction()
22
    {
23
        $this->crudPanel->setHeading('test', 'create');
24
        $this->assertEquals('test', $this->crudPanel->getHeading('create'));
0 ignored issues
show
Bug introduced by
'create' of type string is incompatible with the type boolean expected by parameter $action of Backpack\CRUD\app\Librar...CrudPanel::getHeading(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

24
        $this->assertEquals('test', $this->crudPanel->getHeading(/** @scrutinizer ignore-type */ 'create'));
Loading history...
25
        $this->assertEquals($this->crudPanel->get('create.heading'), $this->crudPanel->getHeading('create'));
26
    }
27
28
    public function testItCanSetAndGetTheSubheadingFromTheAction()
29
    {
30
        $this->crudPanel->setSubheading('test', 'create');
31
        $this->assertEquals('test', $this->crudPanel->getSubheading('create'));
0 ignored issues
show
Bug introduced by
'create' of type string is incompatible with the type boolean expected by parameter $action of Backpack\CRUD\app\Librar...dPanel::getSubheading(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
        $this->assertEquals('test', $this->crudPanel->getSubheading(/** @scrutinizer ignore-type */ 'create'));
Loading history...
32
        $this->assertEquals($this->crudPanel->get('create.subheading'), $this->crudPanel->getSubheading('create'));
33
    }
34
35
    public function testItCanSetAndGetTheSubheading()
36
    {
37
        $this->crudPanel->setModel(User::class);
38
        $request = request()->create('/admin/users/create', 'POST', ['name' => 'foo']);
39
        $request->setRouteResolver(function () use ($request) {
40
            return (new Route('POST', 'admin/users/create', ['UserCrudController', 'create']))->bind($request);
41
        });
42
        $this->crudPanel->setRequest($request);
43
44
        $this->crudPanel->setOperation('create');
45
        $this->crudPanel->setSubheading('test');
46
        $this->assertEquals('test', $this->crudPanel->getSubheading());
47
        $this->assertEquals($this->crudPanel->get('create.subheading'), $this->crudPanel->getSubheading());
48
    }
49
50
    public function testItCanSetAndGetTheHeading()
51
    {
52
        $this->crudPanel->setModel(User::class);
53
        $request = request()->create('/admin/users/create', 'POST', ['name' => 'foo']);
54
        $request->setRouteResolver(function () use ($request) {
55
            return (new Route('POST', 'admin/users/create', ['UserCrudController', 'create']))->bind($request);
56
        });
57
        $this->crudPanel->setRequest($request);
58
59
        $this->crudPanel->setOperation('create');
60
        $this->crudPanel->setHeading('test');
61
        $this->assertEquals('test', $this->crudPanel->getHeading());
62
        $this->assertEquals($this->crudPanel->get('create.heading'), $this->crudPanel->getHeading());
63
    }
64
65
    public function testItCanSetAndGetTheTitle()
66
    {
67
        $this->crudPanel->setModel(User::class);
68
        $request = request()->create('/admin/users/create', 'POST', ['name' => 'foo']);
69
        $request->setRouteResolver(function () use ($request) {
70
            return (new Route('POST', 'admin/users/create', ['UserCrudController', 'create']))->bind($request);
71
        });
72
        $this->crudPanel->setRequest($request);
73
74
        $this->crudPanel->setOperation('create');
75
        $this->crudPanel->setTitle('test');
76
77
        $this->assertEquals('test', $this->crudPanel->getTitle());
78
        $this->assertEquals($this->crudPanel->get('create.title'), $this->crudPanel->getTitle());
79
    }
80
}
81