DatabaseTest::testTableDrop()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 13
rs 9.9666
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
class DatabaseTest extends AbstractTableTest
7
{
8
    /**
9
     * @throws \Exception
10
     */
11
    public function testTableList()
12
    {
13
        $res = $this->r()
14
                    ->db()
15
                    ->tableList()
16
                    ->run();
17
18
        $this->assertInternalType('array', $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

18
        $this->assertInternalType('array', $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...
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

18
        /** @scrutinizer ignore-deprecated */ $this->assertInternalType('array', $res->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...
19
    }
20
21
    /**
22
     * @throws \Exception
23
     */
24
    public function testTableCreate()
25
    {
26
        $res = $this->r()
27
                    ->db()
28
                    ->tableCreate('createtable')
29
                    ->run();
30
31
        $this->assertObStatus(['tables_created' => 1], $res->getData());
32
33
        $this->r()
34
             ->db()
35
             ->tableDrop('createtable')
36
             ->run();
37
    }
38
39
    /**
40
     * @throws \Exception
41
     */
42
    public function testTableDrop()
43
    {
44
        $this->r()
45
             ->db()
46
             ->tableCreate('createtable')
47
             ->run();
48
49
        $res = $this->r()
50
                    ->db()
51
                    ->tableDrop('createtable')
52
                    ->run();
53
54
        $this->assertObStatus(['tables_dropped' => 1], $res->getData());
55
    }
56
}
57