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 — add-more-tests ( 8dd05e )
by
unknown
10:34
created

CrudPanelMacroTest::testThrowsErrorIfMacroExists()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 7
c 1
b 0
f 1
nc 2
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\Macroable
7
 */
8
class CrudPanelMacroTest extends BaseCrudPanelTest
9
{
10
     public function testItCanRegisterMacro()
11
     {
12
          $this->crudPanel::macro('validMacro',function() {
13
               return true;
14
          });
15
          
16
          $this->assertTrue($this->crudPanel->validMacro());
0 ignored issues
show
Bug introduced by
The method validMacro() does not exist on Backpack\CRUD\app\Library\CrudPanel\CrudPanel. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

16
          $this->assertTrue($this->crudPanel->/** @scrutinizer ignore-call */ validMacro());
Loading history...
17
     }
18
19
    public function testThrowsErrorIfMacroExists()
20
    {
21
     try {
22
          $this->crudPanel::macro('setModel',function() {
23
               return true;
24
             });
25
      } catch (\Throwable $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
26
      }
27
      $this->assertEquals(
28
          new \Symfony\Component\HttpKernel\Exception\HttpException(500, 'Cannot register \'setModel\' macro. \'setModel()\' already exists on Backpack\CRUD\app\Library\CrudPanel\CrudPanel'),
29
          $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...
30
      );
31
    }
32
}
33