Skip to content

Commit e5635df

Browse files
committed
feat(stream): create tests for Client
1 parent fb1907b commit e5635df

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

tests/Unit/ClientTest.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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);
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+
}

0 commit comments

Comments
 (0)