Passed
Push — master ( c0d461...fcaf5a )
by Sergey
01:26 queued 10s
created

ClientTest::testStream()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php
2
3
4
namespace Asiries335\redisSteamPhp\Tests;
5
6
use Asiries335\redisSteamPhp\Client;
7
use Asiries335\redisSteamPhp\ClientRedisStreamPhpInterface;
8
use Asiries335\redisSteamPhp\Stream;
9
use Asiries335\redisSteamPhp\StreamGroupConsumer;
10
use PHPUnit\Framework\TestCase;
11
12
class ClientTest extends TestCase
13
{
14
    private $client;
15
16
    /**
17
     * setUp
18
     *
19
     * @return void
20
     */
21
    public function setUp() : void
22
    {
23
        $connector  = \Mockery::mock(ClientRedisStreamPhpInterface::class);
24
        $this->client = new Client($connector);
0 ignored issues
show
Bug introduced by
$connector of type Mockery\LegacyMockInterface|Mockery\MockInterface is incompatible with the type Asiries335\redisSteamPhp...RedisStreamPhpInterface expected by parameter $redisClient of Asiries335\redisSteamPhp\Client::__construct(). ( Ignorable by Annotation )

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

24
        $this->client = new Client(/** @scrutinizer ignore-type */ $connector);
Loading history...
25
    }
26
27
    /**
28
     * test Stream
29
     *
30
     * @return void
31
     */
32
    public function testStream() : void
33
    {
34
        $result = $this->client->stream('stream-name');
35
36
        $this->assertInstanceOf(Stream::class, $result);
37
    }
38
39
    /**
40
     * test Group
41
     *
42
     * @return void
43
     */
44
    public function testGroup() : void
45
    {
46
        $result = $this->client->streamGroupConsumer('stream-name');
47
48
        $this->assertInstanceOf(StreamGroupConsumer::class, $result);
49
    }
50
}