| Conditions | 1 |
| Paths | 1 |
| Total Lines | 31 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 21 | public function testUpdateUserGetsHandled() |
||
| 22 | { |
||
| 23 | $handler = new UpdateUserHandler($this->userRepository); |
||
| 24 | |||
| 25 | $updatingUser = $this->userRepository->findByUsername('wouter'); |
||
| 26 | |||
| 27 | $command = new UpdateUser($updatingUser, 'wouter', 'randomPassword', 'sumocoders'); |
||
|
|
|||
| 28 | |||
| 29 | $handler->handle($command); |
||
| 30 | |||
| 31 | $this->assertEquals( |
||
| 32 | 'wouter', |
||
| 33 | $this->userRepository->findByUsername('wouter')->getUsername() |
||
| 34 | ); |
||
| 35 | $this->assertEquals( |
||
| 36 | 'sumocoders', |
||
| 37 | $this->userRepository->findByUsername('wouter')->getDisplayName() |
||
| 38 | ); |
||
| 39 | $this->assertEquals( |
||
| 40 | 'randomPassword', |
||
| 41 | $this->userRepository->findByUsername('wouter')->getPassword() |
||
| 42 | ); |
||
| 43 | $this->assertNotEquals( |
||
| 44 | $updatingUser->getDisplayName(), |
||
| 45 | $this->userRepository->findByUsername('wouter')->getDisplayName() |
||
| 46 | ); |
||
| 47 | $this->assertNotEquals( |
||
| 48 | $updatingUser->getPassword(), |
||
| 49 | $this->userRepository->findByUsername('wouter')->getPassword() |
||
| 50 | ); |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
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: