DeleteTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 18
dl 0
loc 31
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testDeleteDocument() 0 26 1
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