| 1 | <?php |
||
| 9 | class RedisQueueStoreConnectionTest extends PHPUnit_Framework_TestCase |
||
| 10 | { |
||
| 11 | public function testGetConfigurationValue() |
||
| 12 | { |
||
| 13 | $class = new ReflectionClass(RedisQueueStoreConnection::class); |
||
| 14 | $method = $class->getMethod('getConfigurationValue'); |
||
| 15 | $method->setAccessible(true); |
||
| 16 | $host = 'localhost'; |
||
| 17 | $port = '9367'; |
||
| 18 | $connection = new RedisQueueStoreConnection([ |
||
| 19 | 'host' => $host, |
||
| 20 | 'port' => $port, |
||
| 21 | ]); |
||
| 22 | $this->assertEquals($host, $method->invoke($connection, 'host')); |
||
| 23 | $this->assertEquals($port, $method->invoke($connection, 'port')); |
||
| 24 | } |
||
| 25 | public function testConnect() |
||
| 26 | { |
||
| 27 | $connection = new RedisQueueStoreConnection([ |
||
| 28 | 'host' => 'localhost', |
||
| 29 | 'port' => '9367', |
||
| 30 | ]); |
||
| 31 | $this->assertTrue($connection->getInstance() instanceof Client); |
||
| 32 | $this->assertSame($connection, $connection->connect()); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |