Test Failed
Pull Request — master (#28)
by Timon
03:33 queued 15s
created

DatabaseTest::testCreateTable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace TBolier\RethinkQL\IntegrationTest\Query;
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());
19
    }
20
21
    /**
22
     * @throws \Exception
23
     */
24
    public function testCreateTable()
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 testDropTable()
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