示例#1
0
 /**
  * Test that nothing happens and no error happens when all mimetypes are
  * already correct and no old ones exist..
  */
 public function testDoNothingWhenOnlyNewFiles()
 {
     $this->addEntries(array(array('test.doc', 'application/msword'), array('test.docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'), array('test.xls', 'application/vnd.ms-excel'), array('test.xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'), array('test.ppt', 'application/vnd.ms-powerpoint'), array('test.pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation')));
     $this->repair->run();
     // force mimetype reload
     DummyFileCache::clearCachedMimeTypes();
     $this->storage->getCache()->loadMimeTypes();
     $this->checkEntries(array(array('test.doc', 'application/msword'), array('test.docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'), array('test.xls', 'application/vnd.ms-excel'), array('test.xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'), array('test.ppt', 'application/vnd.ms-powerpoint'), array('test.pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation')));
 }
示例#2
0
	private function renameMimeTypes($currentMimeTypes, $fixedMimeTypes) {
		$this->addEntries($currentMimeTypes);

		$this->repair->run();

		// force mimetype reload
		DummyFileCache::clearCachedMimeTypes();
		$this->storage->getCache()->loadMimeTypes();

		$this->checkEntries($fixedMimeTypes);
	}