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
![]() |
|||
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 | } |