Example #1
0
 public function testListTubes()
 {
     $expected = ['test1', 'test2', 'test3', 'test4'];
     $this->collection->expects($this->any())->method('sendToAll')->will($this->returnCallback(function ($command, $args, $success, $failure) use($expected) {
         $success(['connection' => null, 'response' => array_slice($expected, 0, 2)]);
         $success(['connection' => null, 'response' => array_slice($expected, 2, 1)]);
         $success(['connection' => null, 'response' => array_slice($expected, 2, 2)]);
     }));
     $actual = $this->pool->listTubes();
     sort($actual);
     // this is so they match
     $this->assertEquals($expected, $actual);
 }