コード例 #1
0
 /**
  * Unit test for eZURLWildcard::isCacheExpired()
  *
  * depends testTranslateDirect
  */
 public function testIsCacheExpired()
 {
     $time = time();
     $this->assertFalse(eZURLWildcard::isCacheExpired($time + 1), "Cache should not be expired");
     eZURLWildcard::expireCache();
     $this->assertTrue(eZURLWildcard::isCacheExpired($time - 1), "Cache should be expired");
 }
コード例 #2
0
 /**
  * Unit test for eZURLWildcard::isCacheExpired()
  **/
 public function testIsCacheExpired()
 {
     $time = time();
     // Cleanup cache & existing wildcards
     self::removeAllWildcards();
     self::createWildcard("testDoubleTranslation1/*", 'content/view/full/2', eZURLWildcard::TYPE_DIRECT);
     $ret = eZURLWildcard::translate($uri = "testDoubleTranslation1/abc");
     sleep(1);
     $this->assertFalse(eZURLWildcard::isCacheExpired($time), "Cache should not be expired");
     eZURLWIldcard::expireCache();
     sleep(1);
     $this->assertTrue(eZURLWildcard::isCacheExpired($time + 1), "Cache should be expired");
 }