Conditions | 1 |
Paths | 1 |
Total Lines | 36 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function testDeleteDocument() |
||
35 | { |
||
36 | $this->r() |
||
37 | ->table('tabletest') |
||
38 | ->insert([ |
||
39 | [ |
||
40 | 'title' => 'Delete document', |
||
41 | ], |
||
42 | ]) |
||
43 | ->run(); |
||
44 | |||
45 | /** @var ResponseInterface $count */ |
||
46 | $count = $this->r() |
||
47 | ->table('tabletest') |
||
48 | ->filter([ |
||
49 | [ |
||
50 | 'title' => 'Delete document', |
||
51 | ], |
||
52 | ]) |
||
53 | ->count() |
||
54 | ->run(); |
||
55 | |||
56 | $this->assertInternalType('int', $count->getData()); |
||
57 | |||
58 | /** @var ResponseInterface $res */ |
||
59 | $res = $this->r() |
||
60 | ->table('tabletest') |
||
61 | ->filter([ |
||
62 | [ |
||
63 | 'title' => 'Delete document', |
||
64 | ], |
||
65 | ]) |
||
66 | ->delete() |
||
67 | ->run(); |
||
68 | |||
69 | $this->assertObStatus(['deleted' => $count->getData()], $res->getData()); |
||
70 | } |
||
72 |