Ejemplo n.º 1
0
 public function tearDown()
 {
     Cache::clear();
     if (Db::getInstance()->isConnected()) {
         Db::getInstance()->enableTransactions();
         Db::getInstance()->rollbackTransaction();
     }
 }
Ejemplo n.º 2
0
 /**
  * @test
  */
 public function shouldCacheNullValues()
 {
     //given
     $function = function () {
         ++CacheTest::$call_count;
         return null;
     };
     //when
     $result1 = Cache::get("id", $function);
     $result2 = Cache::get("id", $function);
     //then
     $this->assertEquals(1, CacheTest::$call_count);
     $this->assertNull($result1);
     $this->assertNull($result2);
 }