From: Alan H. <min...@us...> - 2006-03-29 20:46:47
|
Update of /cvsroot/gallery/gallery2/modules/ffmpeg/test/phpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13971/modules/ffmpeg/test/phpunit Modified Files: FfmpegToolkitTest.class Log Message: Fix bug 1400106 - Set default umask of 022 in UnixPlatform::exec instead of a umask to get desired file permissions; this umask caused problems with dir permissions when unzipping files, even making dirs that unzip then could not write files into. - Added GalleryPlatform::recursiveChmod for archiveextract to use instead of recursiveFixDirPermissions (now deprecated); core API 7.3 - It is now the responsibility of exec'ers to chmod output files to the system preference.. added this for netpbm, ffmpeg, dcraw, zipcart. - Updated unit tests accordingly. Index: FfmpegToolkitTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/ffmpeg/test/phpunit/FfmpegToolkitTest.class,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- FfmpegToolkitTest.class 13 Jan 2006 03:39:32 -0000 1.26 +++ FfmpegToolkitTest.class 29 Mar 2006 20:46:41 -0000 1.27 @@ -50,7 +50,7 @@ parent::setUp(); $gallery->_platform = new FfmpegToolkitTestPlatform(); - $ret = $gallery->_platform->init(); + $ret = $gallery->_platform->init($this); if ($ret) { print $ret->getAsHtml(); return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); @@ -407,6 +407,7 @@ } function testPerformOperation() { + $this->_chmodWasCalled = false; list ($ret, $results) = $this->_toolkit->performOperation('video/avi', 'convert-to-image/jpeg', @@ -417,9 +418,11 @@ return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } $this->assertEquals($results, 'image/jpeg'); + $this->assert($this->_chmodWasCalled, 'chmod not called'); } function testPerformOperationWithOffset() { + $this->_chmodWasCalled = false; list ($ret, $results, $context) = $this->_toolkit->performOperation('video/avi', 'select-offset', @@ -444,6 +447,7 @@ } $this->assertEquals($results, 'image/jpeg', 'mime after convert'); $this->assertEquals(array(), $context, 'no offset'); + $this->assert($this->_chmodWasCalled, 'chmod not called'); } } @@ -455,7 +459,8 @@ */ class FfmpegToolkitTestPlatform { - function init() { + function init(&$test) { + $this->_test =& $test; list ($ret, $this->_ffmpegPath) = GalleryCoreApi::getPluginParameter('module', 'ffmpeg', 'path'); if ($ret) { @@ -836,5 +841,10 @@ function realpath($path) { return $path; } + + function chmod($path, $mode=null) { + $this->_test->_chmodWasCalled = true; + return true; + } } ?> |