DeleteTest::testDeleteDocument()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 26
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertInternalType() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/3369 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

29
        /** @scrutinizer ignore-deprecated */ $this->assertInternalType('int', $count->getData());

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.

Loading history...
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