Conditions | 1 |
Paths | 1 |
Total Lines | 31 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
25 | public function testUpdateUserGetsHandled() |
||
26 | { |
||
27 | $handler = new UpdateUserHandler($this->userRepository); |
||
28 | |||
29 | $updatingUser = $this->userRepository->findByUsername('wouter'); |
||
30 | |||
31 | $command = new UpdateUser($updatingUser, 'wouter', 'randomPassword', 'sumocoders'); |
||
|
|||
32 | |||
33 | $handler->handle($command); |
||
34 | |||
35 | $this->assertEquals( |
||
36 | 'wouter', |
||
37 | $this->userRepository->findByUsername('wouter')->getUsername() |
||
38 | ); |
||
39 | $this->assertEquals( |
||
40 | 'sumocoders', |
||
41 | $this->userRepository->findByUsername('wouter')->getDisplayName() |
||
42 | ); |
||
43 | $this->assertEquals( |
||
44 | 'randomPassword', |
||
45 | $this->userRepository->findByUsername('wouter')->getPassword() |
||
46 | ); |
||
47 | $this->assertNotEquals( |
||
48 | $updatingUser->getDisplayName(), |
||
49 | $this->userRepository->findByUsername('wouter')->getDisplayName() |
||
50 | ); |
||
51 | $this->assertNotEquals( |
||
52 | $updatingUser->getPassword(), |
||
53 | $this->userRepository->findByUsername('wouter')->getPassword() |
||
54 | ); |
||
55 | } |
||
56 | } |
||
57 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: