CanInitializeTraitTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 1
eloc 5
c 2
b 1
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_initialize_fire_once() 0 8 1
1
<?php
2
3
namespace Nip\Form\Tests\Traits;
4
5
use Mockery;
0 ignored issues
show
Bug introduced by
The type Mockery 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...
6
use Nip\Form\Form;
7
use Nip\Form\Tests\AbstractTest;
8
9
/**
10
 * Class CanInitializeTraitTest
11
 * @package Nip\Form\Tests\Traits
12
 */
13
class CanInitializeTraitTest extends AbstractTest
14
{
15
    public function test_initialize_fire_once()
16
    {
17
        /** @var Mockery\Mock|Form $form */
18
        $form = Mockery::mock(Form::class)->makePartial()->shouldAllowMockingProtectedMethods();
19
        $form->shouldReceive('initAction')->once();
0 ignored issues
show
Bug introduced by
The method shouldReceive() does not exist on Nip\Form\Form. 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

19
        $form->/** @scrutinizer ignore-call */ 
20
               shouldReceive('initAction')->once();
Loading history...
Bug introduced by
The method once() does not exist on Nip\Form\Form. 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

19
        $form->shouldReceive('initAction')->/** @scrutinizer ignore-call */ once();
Loading history...
20
21
        $form->initializeIfNotInitialized();
22
        $form->initializeIfNotInitialized();
23
    }
24
}
25