Passed
Pull Request — master (#14)
by Timon
02:48
created

ConnectionCursorTest::testRewindFromCursor()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 20
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 12
nc 2
nop 0
1
<?php
2
3
namespace TBolier\RethinkQL\UnitTest\Connection;
4
5
use TBolier\RethinkQL\Query\MessageInterface;
6
use TBolier\RethinkQL\Response\ResponseInterface;
7
use TBolier\RethinkQL\Types\Response\ResponseType;
8
9
class ConnectionCursorTest extends BaseConnectionTestCase
10
{
11
    public function testRewindFromCursor()
12
    {
13
        $this->connect();
14
15
        $message = \Mockery::mock(MessageInterface::class);
16
        $message->shouldReceive('setOptions')->once();
17
18
        $response = \Mockery::mock(ResponseInterface::class);
19
        $response->shouldReceive('getType')->atLeast()->andReturn(ResponseType::SUCCESS_ATOM);
20
21
        $this->setExpectations($response);
22
23
        try {
24
            $this->connection->rewindFromCursor($message);
25
        } catch (\Exception $e) {
26
            $this->fail($e->getMessage());
27
        }
28
29
        $this->assertTrue(true);
30
    }
31
}
32