Passed
Push — master ( 2f6a1e...868687 )
by Timon
04:41
created

DatabaseTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 44
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateTable() 0 13 1
A testTableList() 0 8 1
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