|
@@ 42-56 (lines=15) @@
|
| 39 |
|
$this->assertEquals('caller_test', $rpcClient->getFromName()); |
| 40 |
|
} |
| 41 |
|
|
| 42 |
|
public function testGetResponse() |
| 43 |
|
{ |
| 44 |
|
$rpcClient = new RpcClient('test', $this->getConnectionManagerMock(), 'caller_test'); |
| 45 |
|
|
| 46 |
|
$rpcClient->publish('test'); |
| 47 |
|
/* @Todo prevent infinite while - improve it */ |
| 48 |
|
$rpcClient->setResponse('testGetResponse() - OK'); |
| 49 |
|
|
| 50 |
|
$rpcClient->onResponse( |
| 51 |
|
$this->getCmobiAMQPMessage('testGetResponse() - OK', |
| 52 |
|
$rpcClient->getCurrentCorrelationId()) |
| 53 |
|
); |
| 54 |
|
|
| 55 |
|
$this->assertEquals('testGetResponse() - OK', $rpcClient->getResponse()); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
public function testGenerateCorrelationId() |
| 59 |
|
{ |
|
@@ 65-77 (lines=13) @@
|
| 62 |
|
$this->assertRegExp(sprintf('/%s/', $rpcClient->getCurrentCorrelationId()), $rpcClient->getQueueName()); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
public function testGetCurrentCorrelationId() |
| 66 |
|
{ |
| 67 |
|
$rpcClient = new RpcClient('test', $this->getConnectionManagerMock(), 'caller_test'); |
| 68 |
|
/* @Todo prevent infinite while - improve it */ |
| 69 |
|
$rpcClient->setResponse('testGetResponse() - OK'); |
| 70 |
|
|
| 71 |
|
$rpcClient->publish('test'); |
| 72 |
|
$rpcClient->onResponse( |
| 73 |
|
$this->getCmobiAMQPMessage('testGetResponse() - OK', |
| 74 |
|
$rpcClient->getCurrentCorrelationId()) |
| 75 |
|
); |
| 76 |
|
$this->assertNotNull($rpcClient->getCurrentCorrelationId()); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
/** |
| 80 |
|
* @return ConnectionManager |