ConnectionCursorTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 12
c 1
b 0
f 0
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRewindFromCursor() 0 19 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\UnitTest\Connection;
5
6
use TBolier\RethinkQL\Message\MessageInterface;
7
use TBolier\RethinkQL\Response\ResponseInterface;
8
use TBolier\RethinkQL\Types\Response\ResponseType;
9
10
class ConnectionCursorTest extends ConnectionTestCase
11
{
12
    public function testRewindFromCursor()
13
    {
14
        $this->connect();
15
16
        $message = \Mockery::mock(MessageInterface::class);
17
        $message->shouldReceive('setOptions')->once();
18
19
        $response = \Mockery::mock(ResponseInterface::class);
20
        $response->shouldReceive('getType')->atLeast()->andReturn(ResponseType::SUCCESS_ATOM);
21
22
        $this->setExpectations($response);
23
24
        try {
25
            $this->connection->rewindFromCursor($message);
0 ignored issues
show
Bug introduced by
$message of type Mockery\LegacyMockInterface|Mockery\MockInterface is incompatible with the type TBolier\RethinkQL\Message\MessageInterface expected by parameter $message of TBolier\RethinkQL\Connec...ion::rewindFromCursor(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
            $this->connection->rewindFromCursor(/** @scrutinizer ignore-type */ $message);
Loading history...
26
        } catch (\Exception $e) {
27
            $this->fail($e->getMessage());
28
        }
29
30
        $this->assertTrue(true);
31
    }
32
}
33