EmptyTableTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 12
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testEmptyTable() 0 17 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 EmptyTableTest extends AbstractTableTest
9
{
10
    /**
11
     * @throws \Exception
12
     */
13
    public function testEmptyTable()
14
    {
15
        /** @var ResponseInterface $count */
16
        $count = $this->r()
17
            ->table('tabletest')
18
            ->filter(['title' => 'Test document'])
19
            ->count()
20
            ->run();
21
22
        $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

22
        /** @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...
23
24
        $res = $this->r()
25
            ->table('tabletest')
26
            ->delete()
27
            ->run();
28
29
        $this->assertObStatus(['deleted' => $count->getData()], $res->getData());
0 ignored issues
show
Bug introduced by
The method getData() does not exist on TBolier\RethinkQL\Response\Cursor. ( Ignorable by Annotation )

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

29
        $this->assertObStatus(['deleted' => $count->getData()], $res->/** @scrutinizer ignore-call */ getData());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
30
    }
31
}
32