Add an explicit check for correct operation to ExifRotationTest
authorMax Semenik <maxsem.wiki@gmail.com>
Thu, 2 Aug 2018 01:26:41 +0000 (18:26 -0700)
committerMax Semenik <maxsem.wiki@gmail.com>
Thu, 2 Aug 2018 01:26:41 +0000 (18:26 -0700)
Makes debugging test failures way easier than just trying to figure out
what errors a couple lines below mean.

Change-Id: I8e7f6b14cef0954c72b22805eee512051a2b3c86

tests/phpunit/includes/media/ExifRotationTest.php

index fff101f..e64d4af 100644 (file)
@@ -190,6 +190,11 @@ class ExifRotationTest extends MediaWikiMediaTestCase {
                        $file = $this->dataFile( $name, $type );
                        $thumb = $file->transform( $params, File::RENDER_NOW | File::RENDER_FORCE );
 
+                       if ( $thumb->isError() ) {
+                               /** @var MediaTransformError $thumb */
+                               $this->fail( $thumb->toText() );
+                       }
+
                        $this->assertEquals(
                                $out[0],
                                $thumb->getWidth(),