コード例 #1
0
 public function testCallWillExecuteCommandAndFireEventProperly()
 {
     $predisClient = m::mock(ClientInterface::class);
     $predisClient->shouldReceive('get')->once()->with('foo')->andReturn('bar');
     $event = m::mock(Dispatcher::class);
     $event->shouldReceive('fire')->once();
     $client = new Predis($predisClient, $event);
     $result = $client->get('foo');
     $this->assertSame('bar', $result);
 }
コード例 #2
0
 /**
  * Returns all keys matching pattern.
  *
  * @param $pattern
  */
 public function keys($pattern)
 {
     return $this->client->keys($pattern);
 }