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

testCrudRequestUpdatesOnEachRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 21
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
namespace Backpack\CRUD\Tests\Unit\Http;
4
5
use Backpack\CRUD\Tests\BaseTestClass;
6
7
/**
8
 * @covers Backpack\CRUD\app\Http\Controllers\CrudController
9
 * @covers Backpack\CRUD\app\Library\CrudPanel\CrudPanel
10
 */
11
class CrudControllerTest extends BaseTestClass
12
{
13
    /**
14
     * Define environment setup.
15
     *
16
     * @param  \Illuminate\Foundation\Application  $app
17
     * @return void
18
     */
19
    protected function defineEnvironment($app)
20
    {
21
        parent::defineEnvironment($app);
22
23
        //$this->crudPanel = app('crud');
24
    }
25
26
    public function testSetRouteName()
27
    {
28
        $crudPanel = app('crud');
29
        $crudPanel->setRouteName('users');
30
31
        $this->assertEquals(url('admin/users'), $crudPanel->getRoute());
32
    }
33
34
    public function testSetRoute()
35
    {
36
        $crudPanel = app('crud');
37
        $crudPanel->setRoute(backpack_url('users'));
38
        $crudPanel->setEntityNameStrings('singular', 'plural');
39
        $this->assertEquals(route('users.index'), $crudPanel->getRoute());
40
    }
41
42
    /**
43
     * @group fail
44
     */
45
    public function testCrudRequestUpdatesOnEachRequest()
46
    {
47
        // create a first request
48
        $firstRequest = request()->create('admin/users/1/edit', 'GET');
49
50
        app()->handle($firstRequest);
0 ignored issues
show
introduced by
The method handle() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

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

50
        app()->/** @scrutinizer ignore-call */ handle($firstRequest);
Loading history...
51
        $firstRequest = app()->request;
52
53
        // see if the first global request has been passed to the CRUD object
54
        $this->assertSame(app('crud')->getRequest(), $firstRequest);
55
56
        // create a second request
57
        $secondRequest = request()->create('admin/users/1', 'PUT', ['name' => 'foo']);
58
        app()->handle($secondRequest);
59
        $secondRequest = app()->request;
60
61
        // see if the second global request has been passed to the CRUD object
62
        $this->assertSame(app('crud')->getRequest(), $secondRequest);
63
64
        // the CRUD object's request should no longer hold the first request, but the second one
65
        $this->assertNotSame(app('crud')->getRequest(), $firstRequest);
66
    }
67
}
68