put() public method

Store an item in the cache for a given number of minutes.
public put ( string $key, mixed $value, float $minutes ) : void
$key string Cache key of the item.
$value mixed Value being stored in cache.
$minutes float Cache ttl.
return void
 public function testShouldPut()
 {
     // Set
     $cacheRepo = m::mock(Repository::class);
     $serializer = m::mock(Serializer::class);
     $component = new LaravelCacheComponent($cacheRepo, $serializer);
     $key = 'foo';
     $value = [(object) ['name' => 'batata']];
     // Expectations
     $serializer->shouldReceive('convert')->once()->with([['name' => 'batata']])->andReturn([['name' => 'chips']]);
     $cacheRepo->shouldReceive('put')->once()->with($key, [['name' => 'chips']], 3)->andReturn($value);
     // Assertion
     $component->put($key, $value, 3);
 }