| Conditions | 3 |
| Paths | 3 |
| Total Lines | 27 |
| Code Lines | 17 |
| Lines | 7 |
| Ratio | 25.93 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | public function testUpdate() |
||
| 8 | { |
||
| 9 | $flushedMockArray = $this->getServiceTest()->getRepositoryTest()->getFlushedMockArray(); |
||
| 10 | $mockArray = $this->getServiceTest()->getRepositoryTest()->getMockArray(); |
||
| 11 | |||
| 12 | View Code Duplication | foreach ($this->getController()->getMainService()->getMainRepository()->createEntity()->getOnlyUpdate() as $key) { |
|
| 13 | if (is_bool($flushedMockArray[$key])) { |
||
| 14 | $flushedMockArray[$key] = !$flushedMockArray[$key]; |
||
| 15 | } else { |
||
| 16 | $flushedMockArray[$key] = $mockArray[$key]; |
||
| 17 | } |
||
| 18 | } |
||
| 19 | |||
| 20 | $response = $this->curlHelper |
||
| 21 | ->setPosFixUrl('/'.$flushedMockArray['id']) |
||
| 22 | ->put($flushedMockArray) |
||
| 23 | ->send() |
||
| 24 | ->getResponse(); |
||
| 25 | |||
| 26 | $this->assertEquals(200, $response['code']); |
||
| 27 | |||
| 28 | $data = json_decode($response['data'], true); |
||
| 29 | |||
| 30 | $this->assertEquals($flushedMockArray['id'], $data['id']); |
||
| 31 | |||
| 32 | $this->assertEquals(true, strtotime($data['updatedAt'])); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.