Skip to content

Commit

Permalink
feat(stream): create tests for Client
Browse files Browse the repository at this point in the history
  • Loading branch information
asiries335 committed Oct 2, 2020
1 parent fb1907b commit e5635df
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tests/Unit/ClientTest.php
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);
}
}

0 comments on commit e5635df

Please sign in to comment.