public function testTtlCaching()
 {
     $dataSet = ['a string value', 1000, new \DateTime()];
     $keysSet = [['a', 'collection', 'of', 'string', 'keys'], [new KeyGenerator()], [100, ['an', 'array', new \DateTime()], 'string-value', 03030303, []]];
     $ttlsSet = [4, 10, 16];
     $waitSet = [4, 6, 6];
     foreach (range(0, count($dataSet) - 1) as $i) {
         self::$m->resetTtl();
         self::$m->setTtl($ttlsSet[$i]);
         self::assertFalse(self::$m->has(...$keysSet[$i]));
         self::assertFalse(self::$m->del(...$keysSet[$i]));
         self::assertNull(self::$m->get(...$keysSet[$i]));
         self::assertTrue(self::$m->set($dataSet[$i], ...$keysSet[$i]));
         self::assertTrue(self::$m->has(...$keysSet[$i]));
         self::assertEquals($dataSet[$i], self::$m->get());
         self::assertEquals($dataSet[$i], self::$m->get(...$keysSet[$i]));
         self::assertTrue(self::$m->del(...$keysSet[$i]));
         self::assertTrue(self::$m->set($dataSet[$i], ...$keysSet[$i]));
         self::$m->setKey(...$keysSet[$i]);
         self::assertTrue(self::$m->del());
         self::assertFalse(self::$m->has());
         self::assertNull(self::$m->get());
         self::assertTrue(self::$m->set($dataSet[$i]));
         self::assertTrue(self::$m->has());
         self::assertEquals($dataSet[$i], self::$m->get());
         self::assertTrue(self::$m->has(...$keysSet[$i]));
         self::assertEquals($dataSet[$i], self::$m->get(...$keysSet[$i]));
     }
     foreach (range(0, count($dataSet) - 1) as $i) {
         sleep($waitSet[$i] - 2);
         self::$m->setKey(...$keysSet[$i]);
         self::assertTrue(self::$m->has());
         self::assertEquals($dataSet[$i], self::$m->get());
         sleep(2);
         self::assertFalse(self::$m->has());
         self::assertNotEquals($dataSet[$i], self::$m->get());
     }
 }
 public function testIsNotEnabledException()
 {
     self::setExpectedException('Scribe\\Wonka\\Exception\\RuntimeException');
     self::$m->setEnabled(false);
     self::$m->get('some-key');
 }