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

testItCanGetTheViewPathsForGivenElement()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 1
b 1
f 0
1
<?php
2
3
namespace Backpack\CRUD\Tests\Unit\CrudPanel;
4
5
use Backpack\CRUD\Tests\config\CrudPanel\BaseCrudPanel;
6
use Backpack\CRUD\ViewNamespaces;
7
use Config;
8
9
/**
10
 * @covers Backpack\CRUD\ViewNamespaces
11
 *
12
 * There is already one registered view namespace `backpack.theme-coreuiv2::` in the `TestsServiceProvider` class.
13
 */
14
class ViewNamespacesTest extends BaseCrudPanel
15
{
16
    public function testAddSingleViewNamespace()
17
    {
18
        ViewNamespaces::addFor('fields', 'crud::fields');
19
        ViewNamespaces::addFor('fields', 'pro::fields');
20
        $this->assertCount(3, ViewNamespaces::getFor('fields'));
21
    }
22
23
    public function testAddMultipleViewNamespace()
24
    {
25
        ViewNamespaces::addFor('fields', ['crud::fields', 'pro::fields']);
26
        $this->assertCount(3, ViewNamespaces::getFor('fields'));
27
    }
28
29
    public function testGetWithFallbackFromConfigViewNamespace()
30
    {
31
        Config::set('backpack.crud.fallback_namespace', ['fields' => ['fallback::fields']]);
32
        Config::set('backpack.crud.view_namespaces', ['fields' => ['config::fields']]);
33
        ViewNamespaces::addFor('fields', ['crud::fields', 'pro::fields']);
34
        $this->assertCount(5, ViewNamespaces::getWithFallbackFor('fields', 'backpack.crud.fallback_namespace.fields'));
35
    }
36
37
    public function testItCanGetTheViewPathsForGivenElement()
38
    {
39
        ViewNamespaces::addFor('fields', ['crud::fields', 'pro::fields']);
40
        $viewPaths = ViewNamespaces::getViewPathsFor('fields', 'test');
41
        $this->assertCount(3, $viewPaths);
42
        $this->assertEquals(['crud::fields.test', 'backpack.theme-coreuiv2::fields.test', 'pro::fields.test'], array_values($viewPaths));
0 ignored issues
show
Bug introduced by
$viewPaths of type Countable|iterable is incompatible with the type array expected by parameter $array of array_values(). ( Ignorable by Annotation )

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

42
        $this->assertEquals(['crud::fields.test', 'backpack.theme-coreuiv2::fields.test', 'pro::fields.test'], array_values(/** @scrutinizer ignore-type */ $viewPaths));
Loading history...
43
    }
44
}
45