public function testResetFailureTopFile()
 {
     $temp = $this->createTempDir(__CLASS__);
     $storage = new ezcCacheStorageFilePlain($temp, array('ttl' => 30));
     $data = array('ID', 'Some/Dir/ID', 'Some/other/Dir/ID/1', 'Some/other/Dir/ID/2', 'Some/other/Dir/ID/3');
     foreach ($data as $id) {
         $storage->store($id, $id);
     }
     $this->assertEquals(5, $storage->countDataItems());
     chmod($storage->getLocation(), 0500);
     clearstatcache();
     try {
         $storage->reset();
         $this->fail('Exception not thrown on non-successful delete.');
     } catch (ezcBaseFilePermissionException $e) {
         self::assertEquals("The file '{$temp}/ID-.cache' can not be removed. (Could not unlink cache file.)", $e->getMessage());
     }
     chmod($storage->getLocation(), 0777);
     chmod($storage->getLocation() . '/Some', 0777);
     chmod($storage->getLocation() . '/Some/other', 0777);
     chmod($storage->getLocation() . '/Some/other/Dir', 0777);
     clearstatcache();
     $this->removeTempDir();
 }