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

CrudPanelMacroTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testThrowsErrorIfMacroExists() 0 11 2
A testItCanRegisterMacro() 0 7 1
1
<?php
2
3
namespace Backpack\CRUD\Tests\Unit\CrudPanel;
4
5
use Backpack\CRUD\Tests\config\CrudPanel\BaseCrudPanel;
6
7
/**
8
 * @covers Backpack\CRUD\app\Library\CrudPanel\Traits\Macroable
9
 */
10
class CrudPanelMacroTest extends BaseCrudPanel
11
{
12
    public function testItCanRegisterMacro()
13
    {
14
        $this->crudPanel::macro('validMacro', function () {
15
            return true;
16
        });
17
18
        $this->assertTrue($this->crudPanel->validMacro());
19
    }
20
21
    public function testThrowsErrorIfMacroExists()
22
    {
23
        try {
24
            $this->crudPanel::macro('setModel', function () {
25
                return true;
26
            });
27
        } catch (\Throwable $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
28
        }
29
        $this->assertEquals(
30
            new \Symfony\Component\HttpKernel\Exception\HttpException(500, 'Cannot register \'setModel\' macro. \'setModel()\' already exists on Backpack\CRUD\app\Library\CrudPanel\CrudPanel', null, ['developer-error-exception']),
31
            $e
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $e does not seem to be defined for all execution paths leading up to this point.
Loading history...
32
        );
33
    }
34
}
35