1 | <?php |
||
2 | declare(strict_types = 1); |
||
3 | |||
4 | namespace TBolier\RethinkQL\IntegrationTest\Operation; |
||
5 | |||
6 | use TBolier\RethinkQL\Response\ResponseInterface; |
||
7 | |||
8 | class DeleteTest extends AbstractTableTest |
||
9 | { |
||
10 | /** |
||
11 | * @throws \Exception |
||
12 | */ |
||
13 | public function testDeleteDocument() |
||
14 | { |
||
15 | $this->r() |
||
16 | ->table('tabletest') |
||
17 | ->insert([ |
||
18 | 'title' => 'Delete document', |
||
19 | ]) |
||
20 | ->run(); |
||
21 | |||
22 | /** @var ResponseInterface $count */ |
||
23 | $count = $this->r() |
||
24 | ->table('tabletest') |
||
25 | ->filter(['title' => 'Delete document']) |
||
26 | ->count() |
||
27 | ->run(); |
||
28 | |||
29 | $this->assertInternalType('int', $count->getData()); |
||
0 ignored issues
–
show
|
|||
30 | |||
31 | /** @var ResponseInterface $res */ |
||
32 | $res = $this->r() |
||
33 | ->table('tabletest') |
||
34 | ->filter(['title' => 'Delete document']) |
||
35 | ->delete() |
||
36 | ->run(); |
||
37 | |||
38 | $this->assertObStatus(['deleted' => $count->getData()], $res->getData()); |
||
39 | } |
||
40 | } |
||
41 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.