| Conditions | 3 |
| Paths | 3 |
| Total Lines | 27 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | public function testChangesUpdates() |
||
| 49 | { |
||
| 50 | set_time_limit(5); |
||
| 51 | |||
| 52 | $feed = $this->r() |
||
| 53 | ->table('tabletest') |
||
| 54 | ->changes() |
||
| 55 | ->run(); |
||
| 56 | |||
| 57 | $this->insertDocument(777); |
||
| 58 | |||
| 59 | $this->r()->table('tabletest')->filter(['id' => 777])->update(['description' => 'cool!'])->run(); |
||
| 60 | |||
| 61 | /** @var ResponseInterface $res */ |
||
| 62 | $i = 777; |
||
| 63 | $old_val = $new_val = []; |
||
| 64 | foreach ($feed as $change) { |
||
| 65 | extract($change); |
||
| 66 | |||
| 67 | if ($old_val !== null) { |
||
| 68 | $this->assertEquals('A document description.', $old_val['description']); |
||
| 69 | $this->assertEquals('cool!', $new_val['description']); |
||
| 70 | |||
| 71 | break; |
||
| 72 | } else { |
||
| 73 | $this->assertEmpty($old_val); |
||
| 74 | $this->assertEquals($i, $new_val['id']); |
||
| 75 | } |
||
| 79 |