Example #1
0
 /**
  * @return null
  */
 public function setUp()
 {
     $this->queueName = 'my-queue';
     $this->adapterData = array('queue' => $this->queueName, 'consumer-tag' => '', 'no-local' => false, 'no-ack' => false, 'exclusive' => true, 'no-wait' => false, 'callback' => null, 'ticket' => null);
     $pInterface = 'Appfuel\\Framework\\MsgBroker\\Amqp\\AmqpProfileInterface';
     $this->profile = $this->getMockBuilder($pInterface)->disableOriginalConstructor()->setMethods(array('getExchangeName', 'getQueueName', 'getExchangeData', 'getQueueData', 'getBindData'))->getMock();
     $this->profile->expects($this->any())->method('getQueueName')->will($this->returnValue($this->queueName));
     $this->task = new ConsumerTask($this->profile);
 }
 /**
  * @return null
  */
 public function setUp()
 {
     $depend = new Dependency();
     $depend->load();
     $this->exchangeName = 'my-exchange';
     $this->adapterData = array('message' => '', 'exchange' => $this->exchangeName, 'route-key' => '', 'mandatory' => false, 'immediate' => false, 'ticket' => null);
     $pInterface = 'Appfuel\\Framework\\MsgBroker\\Amqp\\AmqpProfileInterface';
     $this->profile = $this->getMockBuilder($pInterface)->disableOriginalConstructor()->setMethods(array('getExchangeName', 'getQueueName', 'getExchangeData', 'getQueueData', 'getBindData'))->getMock();
     $this->profile->expects($this->any())->method('getExchangeName')->will($this->returnValue($this->exchangeName));
     $this->task = new PublisherTask($this->profile);
 }
Example #3
0
 /**
  * @depends	testInterface
  * @return	null
  */
 public function testGetBindValues()
 {
     $data = array('a' => 'value-a', 'b' => 'value-b', 'c' => 'value-c');
     $this->profile->expects($this->once())->method('getBindData')->will($this->returnValue($data));
     $expected = array_values($data);
     $this->assertEquals($expected, $this->task->getBindValues());
 }