Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Generate a unique ID
<?php uniqid(string $prefix = "", bool $more_entropy = false): string
<?php it('should have a blank cache', function (): void {

    $cache = Cache::default();



    $key = uniqid();



    expect($cache->get($key))->toBeNull()

        ->and($cache->has($key))->toBeFalse();
<?php it('should set and get a value', function (): void {

    $cache = Cache::default();



    $key = uniqid();



    $cache->set($key, 'value');
<?php     $cache = new Cache($dir);



    $key = uniqid();



    $cache->set($key, 'value');
<?php it('should return null if unserializedContents is false', function (): void {

    $cache = Cache::default();



    $key = uniqid();



    $cache->set($key, 'test');
<?php it('should return false if unserializedContents is false and serializedContents is b:0;', function (): void {

    $cache = Cache::default();



    $key = uniqid();



    $cache->set($key, false);
<?php it('should return null if serializedContents is false', function (): void {

    $cache = Cache::default();



    $key = uniqid();



    $cache->set($key, 'test');