IsEmptyTest::testIsEmpty()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 8
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\IntegrationTest\Transformation;
5
6
use TBolier\RethinkQL\IntegrationTest\Operation\AbstractTableTest;
7
8
class IsEmptyTest extends AbstractTableTest
9
{
10
    /**
11
     * @throws \Exception
12
     */
13
    public function testIsEmpty()
14
    {
15
        $res = $this->r()
16
                    ->table('tabletest')
17
                    ->isEmpty()
18
                    ->run();
19
20
        $this->assertTrue($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

20
        $this->assertTrue($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...
21
    }
22
23
    /**
24
     * @throws \Exception
25
     */
26
    public function testIsNotEmpty()
27
    {
28
        $this->insertDocument(1);
29
30
        $res = $this->r()
31
                    ->table('tabletest')
32
                    ->isEmpty()
33
                    ->run();
34
35
        $this->assertFalse($res->getData());
36
    }
37
}
38