Issues (138)

tests/Traits/CanInitializeTraitTest.php (3 issues)

Labels
Severity
1
<?php
2
3
namespace Nip\Form\Tests\Traits;
4
5
use Mockery;
0 ignored issues
show
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
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...
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