Exemplo n.º 1
0
 /**
  * @group disconnected
  */
 public function testProcessChain()
 {
     $command = $this->getMock('Predis\\Commands\\ICommand');
     $processor1 = $this->getMock('Predis\\Commands\\Processors\\ICommandProcessor');
     $processor1->expects($this->once())->method('process')->with($command);
     $processor2 = $this->getMock('Predis\\Commands\\Processors\\ICommandProcessor');
     $processor2->expects($this->once())->method('process')->with($command);
     $processors = array($processor1, $processor2);
     $chain = new ProcessorChain($processors);
     $chain->process($command);
 }
Exemplo n.º 2
0
 /**
  * @group disconnected
  */
 public function testChainOfProcessors()
 {
     $processor = $this->getMock('Predis\\Commands\\Processors\\ICommandProcessor');
     $processor->expects($this->exactly(2))->method('process');
     $chain = new ProcessorChain();
     $chain->add($processor);
     $chain->add($processor);
     $profile = ServerProfile::getDefault();
     $profile->setProcessor($chain);
     $profile->createCommand('info');
 }