Change-Id: I53099827dc2b2b26b7f3cbc9f0e12030868fdafd
+
+use MediaWiki\Shell\Shell;
+
/**
* Tests related to JPEG chroma subsampling via $wgJpegPixelFormat setting.
*
/**
* Tests related to JPEG chroma subsampling via $wgJpegPixelFormat setting.
*
$path = $thumb->getLocalCopyPath();
$this->assertTrue( is_string( $path ), "path returned for JPEG thumbnail for $fmtStr" );
$path = $thumb->getLocalCopyPath();
$this->assertTrue( is_string( $path ), "path returned for JPEG thumbnail for $fmtStr" );
+ $result = Shell::command( 'identify',
'-format',
'%[jpeg:sampling-factor]',
$path
'-format',
'%[jpeg:sampling-factor]',
$path
- ];
- $retval = null;
- $output = wfShellExec( $cmd, $retval );
- $this->assertTrue( $retval === 0, "ImageMagick's identify command should return success" );
+ )->execute();
+ $this->assertEquals( 0,
+ $result->getExitCode(),
+ "ImageMagick's identify command should return success"
+ );
$expected = $samplingFactor;
$expected = $samplingFactor;
- $actual = trim( $output );
+ $actual = trim( $result->getStdout() );
$this->assertEquals(
$expected,
$this->assertEquals(
$expected,
"IM identify expects JPEG chroma subsampling \"$expected\" for $fmtStr"
);
}
"IM identify expects JPEG chroma subsampling \"$expected\" for $fmtStr"
);
}