size() public static method

Returns number of stored objects.
public static size ( ) : integer
return integer
Beispiel #1
0
 /**
  * @test
  */
 public function shouldUseDifferentKeysForDifferentClosures()
 {
     //when
     $result1 = Cache::memoize(function () {
         return 1;
     });
     $result2 = Cache::memoize(function () {
         return 2;
     });
     //then
     $this->assertEquals(2, Cache::size());
     $this->assertEquals(1, $result1);
     $this->assertEquals(2, $result2);
 }