[Pkg-owncloud-commits] [owncloud] 54/273: Added test case for when target mime types already exist

David Prévot taffit at moszumanska.debian.org
Fri Jul 4 03:12:57 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit b749292c18367a653d11d9d93e3320cf1dc9d330
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed Jun 25 19:35:05 2014 +0200

    Added test case for when target mime types already exist
---
 tests/lib/repair/repairmimetypes.php | 46 ++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/tests/lib/repair/repairmimetypes.php b/tests/lib/repair/repairmimetypes.php
index 42af116..9160050 100644
--- a/tests/lib/repair/repairmimetypes.php
+++ b/tests/lib/repair/repairmimetypes.php
@@ -92,6 +92,52 @@ class TestRepairMimeTypes extends PHPUnit_Framework_TestCase {
 			)
 		);
 	}
+
+	/**
+	 * Test renaming and splitting old office mime types when
+	 * new ones already exist
+	 */
+	public function testRenameOfficeMimeTypesWhenExist() {
+		$this->addEntries(
+			array(
+				array('test.doc', 'application/msword'),
+				array('test.docx', 'application/msword'),
+				array('test.xls', 'application/msexcel'),
+				array('test.xlsx', 'application/msexcel'),
+				array('test.ppt', 'application/mspowerpoint'),
+				array('test.pptx', 'application/mspowerpoint'),
+				// make it so that the new mimetypes already exist
+				array('bogus.docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'),
+				array('bogus.xlsx', 'application/vnd.ms-excel'),
+				array('bogus.pptx', 'application/vnd.ms-powerpoint'),
+				array('bogus2.docx', 'application/wrong'),
+				array('bogus2.xlsx', 'application/wrong'),
+				array('bogus2.pptx', 'application/wrong'),
+			)
+		);
+
+		$this->repair->run();
+
+		// force mimetype reload
+		$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/msexcel'),
+				array('test.xlsx', 'application/vnd.ms-excel'),
+				array('test.ppt', 'application/mspowerpoint'),
+				array('test.pptx', 'application/vnd.ms-powerpoint'),
+				array('bogus.docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'),
+				array('bogus.xlsx', 'application/vnd.ms-excel'),
+				array('bogus.pptx', 'application/vnd.ms-powerpoint'),
+				array('bogus2.docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'),
+				array('bogus2.xlsx', 'application/vnd.ms-excel'),
+				array('bogus2.pptx', 'application/vnd.ms-powerpoint'),
+			)
+		);
+	}
 }
 
 /**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list