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); }
/** * Get the value of key * * @param $key * @return mixed */ public function get($key) { return $this->client->get($key); }