Passed
Pull Request — master (#18)
by Marc
03:37
created

ConnectionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 42
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testConnect() 0 12 1
1
<?php
2
declare(strict_types=1);
3
4
namespace TBolier\RethinkQL\IntegrationTest\Connection;
5
6
use Mockery;
7
use Mockery\MockInterface;
8
use TBolier\RethinkQL\Connection\ConnectionInterface;
9
use TBolier\RethinkQL\Connection\OptionsInterface;
10
use TBolier\RethinkQL\IntegrationTest\BaseTestCase;
11
use TBolier\RethinkQL\Response\ResponseInterface;
12
use TBolier\RethinkQL\Types\Query\QueryType;
13
14
class ConnectionTest extends BaseTestCase
15
{
16
    /**
17
     * @var MockInterface
18
     */
19
    private $optionsMock;
20
21
    public function setUp()
22
    {
23
        parent::setUp();
24
25
        $this->optionsMock = Mockery::mock(OptionsInterface::class);
26
    }
27
28
    /**
29
     * @throws \Exception
30
     */
31
    public function testConnect()
32
    {
33
        /** @var ConnectionInterface $connection */
34
        $connection = $this->createConnection('phpunit_default')->connect();
35
36
        $this->assertInstanceOf(ConnectionInterface::class, $connection);
37
38
//        $result = $connection->expr('foo');
39
//
40
//        $this->assertInstanceOf(ResponseInterface::class, $result);
41
//        $this->assertEquals('foo', $result->getData()[0]);
42
    }
43
44
//    /**
45
//     * @throws \Exception
46
//     */
47
//    public function testServer()
48
//    {
49
//        /** @var ConnectionInterface $connection */
50
//        $res = $this->createConnection('phpunit_default')->connect()->server();
51
//
52
//        $this->assertEquals(QueryType::SERVER_INFO, $res->getType());
53
//        $this->assertInternalType('string', $res->getData()[0]['name']);
54
//    }
55
}
56