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 — use-crud-request ( cebdb6...aa0c40 )
by Pedro
28:13 queued 13:21
created

testItCanCheckIfFilterIsActiveFromRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 7
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
namespace Backpack\CRUD\Tests\Unit\CrudPanel;
4
5
/**
6
 * @covers Backpack\CRUD\app\Library\CrudPanel\Traits\Filters
7
 * @covers Backpack\CRUD\app\Library\CrudPanel\CrudFilter
8
 */
9
class CrudPanelFiltersTest extends BaseCrudPanelTest
10
{
11
    protected $testFilter = [[
12
        'name'  => 'my_filter',
13
        'label' => 'filter label',
14
    ], false, false, false];
15
16
    public function testItEnablesTheFiltersButConsiderThemDisableIfEmpty()
17
    {
18
        $this->crudPanel->enableFilters();
19
        $this->assertFalse($this->crudPanel->filtersEnabled());
20
    }
21
22
    public function testItCanAddFiltersToCrudPanel()
23
    {
24
        $this->crudPanel->addFilter(...$this->testFilter);
0 ignored issues
show
Bug introduced by
$this->testFilter is expanded, but the parameter $options of Backpack\CRUD\app\Librar...\CrudPanel::addFilter() does not expect variable arguments. ( 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->crudPanel->addFilter(/** @scrutinizer ignore-type */ ...$this->testFilter);
Loading history...
25
26
        $this->assertCount(1, $this->crudPanel->filters());
27
    }
28
29
    public function testItCanClearFilters()
30
    {
31
        $this->crudPanel->addFilter(...$this->testFilter);
0 ignored issues
show
Bug introduced by
$this->testFilter is expanded, but the parameter $options of Backpack\CRUD\app\Librar...\CrudPanel::addFilter() does not expect variable arguments. ( 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->crudPanel->addFilter(/** @scrutinizer ignore-type */ ...$this->testFilter);
Loading history...
32
33
        $this->crudPanel->clearFilters();
34
        $this->assertCount(0, $this->crudPanel->filters());
35
    }
36
37
    public function testItCanCheckIfFilterIsActiveFromRequest()
38
    {
39
        $this->crudPanel->setModel(User::class);
0 ignored issues
show
Bug introduced by
The type Backpack\CRUD\Tests\Unit\CrudPanel\User was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
40
        $request = request()->create('/admin/users', 'GET', ['my_custom_filter' => 'foo']);
41
        $request->setRouteResolver(function () use ($request) {
42
            return (new Route('GET', 'admin/users', ['UserCrudController', 'index']))->bind($request);
0 ignored issues
show
Bug introduced by
The type Backpack\CRUD\Tests\Unit\CrudPanel\Route was not found. Did you mean Route? If so, make sure to prefix the type with \.
Loading history...
43
        });
44
        $this->crudPanel->setRequest($request);
45
46
        $isActive = CrudFilter::name('my_custom_filter')->isActive();
0 ignored issues
show
Bug introduced by
The type Backpack\CRUD\Tests\Unit\CrudPanel\CrudFilter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
47
        $this->assertTrue($isActive);
48
    }
49
}
50