Total Complexity | 6 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class ChangesTest extends AbstractTableTest |
||
9 | { |
||
10 | /** |
||
11 | * @throws \Exception |
||
12 | */ |
||
13 | public function testChangesCreate() |
||
14 | { |
||
15 | set_time_limit(5); |
||
16 | |||
17 | $feed = $this->r() |
||
18 | ->table('tabletest') |
||
19 | ->changes() |
||
20 | ->run(); |
||
21 | |||
22 | $this->insertDocument(1); |
||
23 | $this->insertDocument(2); |
||
24 | $this->insertDocument(3); |
||
25 | $this->insertDocument(4); |
||
26 | $this->insertDocument(5); |
||
27 | |||
28 | /** @var ResponseInterface $res */ |
||
29 | $i = 1; |
||
30 | $old_val = $new_val = []; |
||
31 | foreach ($feed as $change) { |
||
32 | extract($change); |
||
33 | |||
34 | $this->assertEmpty($old_val); |
||
35 | $this->assertEquals($i, $new_val['id']); |
||
36 | |||
37 | if ($i === 5) { |
||
38 | break; |
||
39 | } |
||
40 | |||
41 | $i++; |
||
42 | } |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @throws \Exception |
||
47 | */ |
||
48 | public function testChangesUpdates() |
||
75 | } |
||
76 | } |
||
79 |