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