function testCacheHit() { registerTestingIni( 'testing2.ini', 'test = 1' ); registerTestingIni( 'testing2.ini.override', 'test = 2' ); $ini = new Ini(VAR_DIR . 'testing2.ini', true); //ini should be cached here... $ini_mock = new IniMockVersionOverride($this); touch($ini->getCacheFile(), time()+100); $ini_mock->expectNever('_parse'); $ini_mock->expectNever('_saveCache'); $ini_mock->__construct(VAR_DIR . 'testing2.ini', true); $ini_mock->tally(); $ini->resetCache(); }
function testCacheHitFileWasModified() { registerTestingIni( 'testing.ini', 'test = 1' ); $ini = new Ini(VAR_DIR . 'testing.ini', true); //ini should be cached here... // caching happens very quickly we have to tweak the original file modification time // in order to test touch($ini->getOriginalFile(), time()+100); $ini_mock = new IniMockVersion($this); $ini_mock->expectOnce('_parse'); $ini_mock->expectOnce('_saveCache'); $ini_mock->Ini(VAR_DIR . 'testing.ini', true); $ini_mock->tally(); $ini->resetCache(); }