get() public method

Retrieve an item from the cache by key.
public get ( string $key ) : mixed
$key string Cache key of the item to be retrieved.
return mixed
 public function testShouldGet()
 {
     // Set
     $cacheRepo = m::mock(Repository::class);
     $serializer = m::mock(Serializer::class);
     $component = new LaravelCacheComponent($cacheRepo, $serializer);
     $key = 'foo';
     $value = 'bar';
     // Expectations
     $cacheRepo->shouldReceive('get')->once()->with($key, null)->andReturn($value);
     // Assertion
     $this->assertEquals($value, $component->get($key));
 }