jenkins-bot has submitted this change and it was merged.

Change subject: Move XMP* classes to includes/libs
......................................................................


Move XMP* classes to includes/libs

These no longer have any dependencies upon MediaWiki and can be split
out into a separate library.

Tests were updated for the new location and to no longer depend upon
MediaWikiTestCase.

Bug: T100922
Change-Id: I6ad507fa883d5934b807f9e31c507659d0730b52
---
M autoload.php
R includes/libs/xmp/XMP.php
R includes/libs/xmp/XMPInfo.php
R includes/libs/xmp/XMPValidate.php
R tests/phpunit/includes/libs/xmp/XMPTest.php
R tests/phpunit/includes/libs/xmp/XMPValidateTest.php
6 files changed, 14 insertions(+), 11 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/autoload.php b/autoload.php
index 198e477..b6e0b8c 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1561,9 +1561,9 @@
        'XCFHandler' => __DIR__ . '/includes/media/XCF.php',
        'XCacheBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/XCacheBagOStuff.php',
        'XMLRCFeedFormatter' => __DIR__ . 
'/includes/rcfeed/XMLRCFeedFormatter.php',
-       'XMPInfo' => __DIR__ . '/includes/media/XMPInfo.php',
-       'XMPReader' => __DIR__ . '/includes/media/XMP.php',
-       'XMPValidate' => __DIR__ . '/includes/media/XMPValidate.php',
+       'XMPInfo' => __DIR__ . '/includes/libs/xmp/XMPInfo.php',
+       'XMPReader' => __DIR__ . '/includes/libs/xmp/XMP.php',
+       'XMPValidate' => __DIR__ . '/includes/libs/xmp/XMPValidate.php',
        'Xhprof' => __DIR__ . '/includes/libs/Xhprof.php',
        'XhprofData' => __DIR__ . '/includes/libs/XhprofData.php',
        'Xml' => __DIR__ . '/includes/Xml.php',
diff --git a/includes/media/XMP.php b/includes/libs/xmp/XMP.php
similarity index 100%
rename from includes/media/XMP.php
rename to includes/libs/xmp/XMP.php
diff --git a/includes/media/XMPInfo.php b/includes/libs/xmp/XMPInfo.php
similarity index 100%
rename from includes/media/XMPInfo.php
rename to includes/libs/xmp/XMPInfo.php
diff --git a/includes/media/XMPValidate.php b/includes/libs/xmp/XMPValidate.php
similarity index 100%
rename from includes/media/XMPValidate.php
rename to includes/libs/xmp/XMPValidate.php
diff --git a/tests/phpunit/includes/media/XMPTest.php 
b/tests/phpunit/includes/libs/xmp/XMPTest.php
similarity index 93%
rename from tests/phpunit/includes/media/XMPTest.php
rename to tests/phpunit/includes/libs/xmp/XMPTest.php
index bffe415..ac52a39 100644
--- a/tests/phpunit/includes/media/XMPTest.php
+++ b/tests/phpunit/includes/libs/xmp/XMPTest.php
@@ -4,11 +4,14 @@
  * @group Media
  * @covers XMPReader
  */
-class XMPTest extends MediaWikiTestCase {
+class XMPTest extends PHPUnit_Framework_TestCase  {
 
        protected function setUp() {
                parent::setUp();
-               $this->checkPHPExtension( 'exif' ); # Requires libxml to do XMP 
parsing
+               # Requires libxml to do XMP parsing
+               if ( !extension_loaded( 'exif' ) ) {
+                       $this->markTestSkipped( "PHP extension 'exif' is not 
loaded, skipping." );
+               }
        }
 
        /**
@@ -33,7 +36,7 @@
        }
 
        public static function provideXMPParse() {
-               $xmpPath = __DIR__ . '/../../data/xmp/';
+               $xmpPath = __DIR__ . '/../../../data/xmp/';
                $data = [];
 
                // $xmpFiles format: array of arrays with first arg file base 
name,
@@ -86,7 +89,7 @@
         * @covers XMPReader::parseExtended
         */
        public function testExtendedXMP() {
-               $xmpPath = __DIR__ . '/../../data/xmp/';
+               $xmpPath = __DIR__ . '/../../../data/xmp/';
                $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
                $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -118,7 +121,7 @@
         * @covers XMPReader::parseExtended
         */
        public function testExtendedXMPWithWrongGUID() {
-               $xmpPath = __DIR__ . '/../../data/xmp/';
+               $xmpPath = __DIR__ . '/../../../data/xmp/';
                $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
                $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -149,7 +152,7 @@
         * @covers XMPReader::parseExtended
         */
        public function testExtendedXMPMissingPacket() {
-               $xmpPath = __DIR__ . '/../../data/xmp/';
+               $xmpPath = __DIR__ . '/../../../data/xmp/';
                $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
                $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -180,7 +183,7 @@
        public function testCheckParseSafety() {
 
                // Test for detection
-               $xmpPath = __DIR__ . '/../../data/xmp/';
+               $xmpPath = __DIR__ . '/../../../data/xmp/';
                $file = fopen( $xmpPath . 'doctype-included.xmp', 'rb' );
                $valid = false;
                $reader = new XMPReader();
diff --git a/tests/phpunit/includes/media/XMPValidateTest.php 
b/tests/phpunit/includes/libs/xmp/XMPValidateTest.php
similarity index 95%
rename from tests/phpunit/includes/media/XMPValidateTest.php
rename to tests/phpunit/includes/libs/xmp/XMPValidateTest.php
index 6a00629..7f7ea93 100644
--- a/tests/phpunit/includes/media/XMPValidateTest.php
+++ b/tests/phpunit/includes/libs/xmp/XMPValidateTest.php
@@ -5,7 +5,7 @@
 /**
  * @group Media
  */
-class XMPValidateTest extends MediaWikiTestCase {
+class XMPValidateTest extends PHPUnit_Framework_TestCase {
 
        /**
         * @dataProvider provideDates

-- 
To view, visit https://gerrit.wikimedia.org/r/311907
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ad507fa883d5934b807f9e31c507659d0730b52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to