-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stream): create tests for Client
- Loading branch information
1 parent
fb1907b
commit e5635df
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
|
||
namespace Asiries335\redisSteamPhp\Tests; | ||
|
||
use Asiries335\redisSteamPhp\Client; | ||
use Asiries335\redisSteamPhp\ClientRedisStreamPhpInterface; | ||
use Asiries335\redisSteamPhp\Stream; | ||
use Asiries335\redisSteamPhp\StreamGroupConsumer; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ClientTest extends TestCase | ||
{ | ||
private $client; | ||
|
||
/** | ||
* setUp | ||
* | ||
* @return void | ||
*/ | ||
public function setUp() : void | ||
{ | ||
$connector = \Mockery::mock(ClientRedisStreamPhpInterface::class); | ||
$this->client = new Client($connector); | ||
} | ||
|
||
/** | ||
* test Stream | ||
* | ||
* @return void | ||
*/ | ||
public function testStream() : void | ||
{ | ||
$result = $this->client->stream('stream-name'); | ||
|
||
$this->assertInstanceOf(Stream::class, $result); | ||
} | ||
|
||
/** | ||
* test Group | ||
* | ||
* @return void | ||
*/ | ||
public function testGroup() : void | ||
{ | ||
$result = $this->client->streamGroupConsumer('stream-name'); | ||
|
||
$this->assertInstanceOf(StreamGroupConsumer::class, $result); | ||
} | ||
} |