예제 #1
0
 /**
  * Tests the close method of the consumer.
  */
 public function testClose()
 {
     $consumer = new Consumer($this->queue, $this->loop, 1);
     $consumer->on('end', $this);
     $this->loop->expects($this->once())->method('cancelTimer')->with($this->equalTo($this->timer));
     $consumer->close();
     $this->assertAttributeSame(true, 'closed', $consumer);
     $this->assertAttributeSame(null, 'queue', $consumer);
     $this->assertSame(1, $this->counter);
 }
예제 #2
0
 /**
  * Tests the close method.
  */
 public function testClose()
 {
     $producer = new Producer($this->exchange, $this->loop, 1);
     $producer->on('end', $this);
     $this->loop->expects($this->once())->method('cancelTimer')->with($this->timer);
     $producer->close();
     $this->assertAttributeSame(true, 'closed', $producer);
     $this->assertAttributeSame(null, 'exchange', $producer);
     $this->assertSame(1, $this->counter);
 }