1 | <?php |
||
25 | class ProjectionTests extends TestCase |
||
26 | { |
||
27 | /** |
||
28 | * Test create. |
||
29 | */ |
||
30 | public function testCreate() |
||
31 | { |
||
32 | $this |
||
33 | ->given( |
||
34 | $readModel = new PublishedPost( |
||
35 | PostId::fromNative(md5(rand())), |
||
36 | $this->faker->title, |
||
37 | $this->faker->text() |
||
|
|||
38 | ) |
||
39 | ) |
||
40 | ->and($action = Action::NONE()) |
||
41 | ->when($projection = new Projection($action, $readModel)) |
||
42 | ->then() |
||
43 | ->object($projection->readModel()) |
||
44 | ->isEqualTo($readModel) |
||
45 | ->object($projection->action()) |
||
46 | ->isEqualTo($action) |
||
47 | ; |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Test SetReadModel method. |
||
52 | */ |
||
53 | public function testSetReadModel() |
||
82 | |||
83 | /** |
||
84 | * Test SetAction method. |
||
85 | */ |
||
86 | public function testSetAction() |
||
108 | } |
||
109 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.