From: Alan H. <min...@us...> - 2004-12-30 23:11:09
|
Update of /cvsroot/gallery/gallery2/modules/core/test/phpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6067/core/test/phpunit Modified Files: AlbumTest.class CreateThumbnailOptionTest.class ItemEditAlbumPluginTest.class ItemEditPhotoPluginTest.class ItemEditPhotoThumbnailPluginTest.class ItemEditRotateAndScalePhotoPluginTest.class ItemMakeHighlightControllerTest.class ItemMoveControllerTest.class ItemMoveSingleControllerTest.class ItemTest.class Log Message: ack! resize operation doesn't maintain aspect ratio (except in imagemagick?). add optional 2nd param to scale operation instead. Index: ItemEditRotateAndScalePhotoPluginTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/test/phpunit/ItemEditRotateAndScalePhotoPluginTest.class,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ItemEditRotateAndScalePhotoPluginTest.class 29 Dec 2004 20:50:27 -0000 1.12 +++ ItemEditRotateAndScalePhotoPluginTest.class 30 Dec 2004 23:10:22 -0000 1.13 @@ -54,7 +54,7 @@ /* Register operations that we can perform on our mock data items */ $ret = GalleryCoreApi::registerToolkitOperation('ItemEditRotateAndScalePhotoPluginTestToolkit', - array('test/file'), 'resize', + array('test/file'), 'scale', array(array('type' => 'int', 'description' => 'test'), array('type' => 'int', 'description' => 'test')), 'test-description'); @@ -73,14 +73,10 @@ } $ret = GalleryCoreApi::registerToolkitOperation('ItemEditRotateAndScalePhotoPluginTestToolkit', - array('test/file'), - 'resize', - array(array('type' => 'int', - 'description' => 'test'), - array('type' => 'int', - 'description' => 'test')), - 'test-description', - ''); + array('test/file'), 'resize', + array(array('type' => 'int', 'description' => 'test'), + array('type' => 'int', 'description' => 'test')), + 'test-description', ''); if ($ret->isError()) { print $ret->getAsHtml(); return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); @@ -258,7 +254,7 @@ return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } - $this->assertEquals('rotate|90;resize|200,200', $this->_derivative[0]->getDerivativeOperations()); + $this->assertEquals('rotate|90;scale|200,200', $this->_derivative[0]->getDerivativeOperations()); } function testScaleMissing() { Index: ItemMoveSingleControllerTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/test/phpunit/ItemMoveSingleControllerTest.class,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ItemMoveSingleControllerTest.class 19 Oct 2004 22:59:33 -0000 1.7 +++ ItemMoveSingleControllerTest.class 30 Dec 2004 23:10:23 -0000 1.8 @@ -49,14 +49,18 @@ /* Register operations that we can perform on our mock data items */ $ret = GalleryCoreApi::registerToolkitOperation('ItemMoveSingleTestToolkit', array('image/test'), 'thumbnail', - array(array('type' => 'int', 'description' => 'foo')), 'test-description'); + array(array('type' => 'int', 'description' => 'foo'), + array('type' => 'int', 'description' => 'foo')), + 'test-description'); if ($ret->isError()) { print $ret->getAsHtml(); return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } $ret = GalleryCoreApi::registerToolkitOperation('ItemMoveSingleTestToolkit', array('image/test'), 'scale', - array(array('type' => 'int', 'description' => 'foo')), 'test-description'); + array(array('type' => 'int', 'description' => 'foo'), + array('type' => 'int', 'description' => 'foo')), + 'test-description'); if ($ret->isError()) { print $ret->getAsHtml(); return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); Index: ItemMoveControllerTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/test/phpunit/ItemMoveControllerTest.class,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ItemMoveControllerTest.class 21 Aug 2004 07:50:04 -0000 1.16 +++ ItemMoveControllerTest.class 30 Dec 2004 23:10:23 -0000 1.17 @@ -49,14 +49,18 @@ /* Register operations that we can perform on our mock data items */ $ret = GalleryCoreApi::registerToolkitOperation('ItemMoveTestToolkit', array('image/test'), 'thumbnail', - array(array('type' => 'int', 'description' => 'foo')), 'test-description'); + array(array('type' => 'int', 'description' => 'foo'), + array('type' => 'int', 'description' => 'foo')), + 'test-description'); if ($ret->isError()) { print $ret->getAsHtml(); return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } $ret = GalleryCoreApi::registerToolkitOperation('ItemMoveTestToolkit', array('image/test'), 'scale', - array(array('type' => 'int', 'description' => 'foo')), 'test-description'); + array(array('type' => 'int', 'description' => 'foo'), + array('type' => 'int', 'description' => 'foo')), + 'test-description'); if ($ret->isError()) { print $ret->getAsHtml(); return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); Index: ItemTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/test/phpunit/ItemTest.class,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- ItemTest.class 11 Dec 2004 17:33:41 -0000 1.47 +++ ItemTest.class 30 Dec 2004 23:10:23 -0000 1.48 @@ -64,32 +64,20 @@ __FILE__); /* Register an operation that we can perform on our mock data items */ + /* Register a jpeg thumbnail in case there are no other toolkits active */ $ret = GalleryCoreApi::registerToolkitOperation('ItemTestToolkit', - array('test/image'), - 'thumbnail', - array(array('type' => 'int', 'description' => 'foo')), - 'itemtest-description'); + array('test/image', 'image/jpeg'), 'thumbnail', + array(array('type' => 'int', 'description' => 'foo'), + array('type' => 'int', 'description' => 'foo')), + 'itemtest-description'); if ($ret->isError()) { return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } /* Register a conversion operation that we can perform on our mock data items */ $ret = GalleryCoreApi::registerToolkitOperation('ItemTestToolkit', - array('test/movie'), - 'convert-to-image/jpeg', - array(), - 'itemtest-description', - 'image/jpeg'); - if ($ret->isError()) { - return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); - } - - /* Register a jpeg thumbnail in case there are no other toolkits active */ - $ret = GalleryCoreApi::registerToolkitOperation('ItemTestToolkit', - array('image/jpeg'), - 'thumbnail', - array(array('type' => 'int', 'description' => 'foo')), - 'itemtest-description'); + array('test/movie'), 'convert-to-image/jpeg', + array(), 'itemtest-description', 'image/jpeg'); if ($ret->isError()) { return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } Index: ItemEditAlbumPluginTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/test/phpunit/ItemEditAlbumPluginTest.class,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ItemEditAlbumPluginTest.class 30 Dec 2004 18:27:54 -0000 1.12 +++ ItemEditAlbumPluginTest.class 30 Dec 2004 23:10:22 -0000 1.13 @@ -56,24 +56,20 @@ /* Register operations that we can perform on our mock data items */ $ret = GalleryCoreApi::registerToolkitOperation('ItemEditAlbumPluginTestToolkit', - array('test/file'), - 'resize', - array(array('type' => 'int', - 'description' => 'test'), - array('type' => 'int', - 'description' => 'test')), - 'test-description'); + array('test/file'), 'scale', + array(array('type' => 'int', 'description' => 'test'), + array('type' => 'int', 'description' => 'test')), + 'test-description'); if ($ret->isError()) { print $ret->getAsHtml(); return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } $ret = GalleryCoreApi::registerToolkitOperation('ItemEditAlbumPluginTestToolkit', - array('test/file'), - 'thumbnail', - array(array('type' => 'int', - 'description' => 'test')), - 'test-description'); + array('test/file'), 'thumbnail', + array(array('type' => 'int', 'description' => 'test'), + array('type' => 'int', 'description' => 'test')), + 'test-description'); if ($ret->isError()) { print $ret->getAsHtml(); return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); @@ -171,13 +167,13 @@ } $this->assert(array(array('order' => 0, 'derivativeType' => 2, - 'derivativeOperations' => 'resize|234,234'), + 'derivativeOperations' => 'scale|234,234'), array('order' => 0, 'derivativeType' => 2, - 'derivativeOperations' => 'resize|345,543'), + 'derivativeOperations' => 'scale|345,543'), array('order' => 0, 'derivativeType' => 2, - 'derivativeOperations' => 'resize|456,456')), + 'derivativeOperations' => 'scale|456,456')), $preferences); } @@ -272,7 +268,7 @@ list ($ret, $ignore) = $this->_createDerivative($child[$i], $child[$i]->getId(), DERIVATIVE_TYPE_IMAGE_RESIZE, - 'resize|100,100', + 'scale|100,100', 'test/file'); if ($ret->isError()) { return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); @@ -342,9 +338,9 @@ } for ($i = 0; $i < 2; $i++) { - $this->assertEquals('resize|234,234', $resizes[$child[$i]->getId()][0]->getDerivativeOperations()); - $this->assertEquals('resize|345,543', $resizes[$child[$i]->getId()][1]->getDerivativeOperations()); - $this->assertEquals('resize|456,456', $resizes[$child[$i]->getId()][2]->getDerivativeOperations()); + $this->assertEquals('scale|234,234', $resizes[$child[$i]->getId()][0]->getDerivativeOperations()); + $this->assertEquals('scale|345,543', $resizes[$child[$i]->getId()][1]->getDerivativeOperations()); + $this->assertEquals('scale|456,456', $resizes[$child[$i]->getId()][2]->getDerivativeOperations()); } } @@ -429,7 +425,7 @@ if (isset($resizes[$photo->getId()])) { $resizes = $resizes[$photo->getId()]; $this->assertEquals(1, sizeof($resizes), 'There should only be one resize'); - $this->assertEquals('resize|50,50', $resizes[0]->getDerivativeOperations(), 'The resize operation should be resize|50,50'); + $this->assertEquals('scale|50,50', $resizes[0]->getDerivativeOperations(), 'The resize operation should be resize|50,50'); } } } Index: ItemEditPhotoThumbnailPluginTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/test/phpunit/ItemEditPhotoThumbnailPluginTest.class,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ItemEditPhotoThumbnailPluginTest.class 12 Dec 2004 06:29:22 -0000 1.13 +++ ItemEditPhotoThumbnailPluginTest.class 30 Dec 2004 23:10:22 -0000 1.14 @@ -55,34 +55,27 @@ /* Register operations that we can perform on our mock data items */ $ret = GalleryCoreApi::registerToolkitOperation('ItemEditPhotoThumbnailPluginTestToolkit', - array('test/file'), - 'scale', - array(array('type' => 'int', - 'description' => 'test')), - 'test-description'); + array('test/file'), 'scale', + array(array('type' => 'int', 'description' => 'test'), + array('type' => 'int', 'description' => 'test')), + 'test-description'); if ($ret->isError()) { return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } $ret = GalleryCoreApi::registerToolkitOperation('ItemEditPhotoThumbnailPluginTestToolkit', - array('test/file'), - 'rotate', - array(array('type' => 'int', - 'description' => 'test')), - 'test-description'); + array('test/file'), 'rotate', + array(array('type' => 'int', 'description' => 'test')), + 'test-description'); if ($ret->isError()) { return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } $ret = GalleryCoreApi::registerToolkitOperation('ItemEditPhotoThumbnailPluginTestToolkit', - array('test/file'), - 'resize', - array(array('type' => 'int', - 'description' => 'test'), - array('type' => 'int', - 'description' => 'test')), - 'test-description', - ''); + array('test/file'), 'resize', + array(array('type' => 'int', 'description' => 'test'), + array('type' => 'int', 'description' => 'test')), + 'test-description', ''); if ($ret->isError()) { return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } Index: ItemEditPhotoPluginTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/test/phpunit/ItemEditPhotoPluginTest.class,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ItemEditPhotoPluginTest.class 29 Dec 2004 04:47:20 -0000 1.5 +++ ItemEditPhotoPluginTest.class 30 Dec 2004 23:10:22 -0000 1.6 @@ -55,7 +55,7 @@ /* Register operations that we can perform on our mock data items */ $ret = GalleryCoreApi::registerToolkitOperation('ItemEditPhotoPluginTestToolkit', - array('test/file'), 'resize', + array('test/file'), 'scale', array(array('type' => 'int', 'description' => 'test'), array('type' => 'int', 'description' => 'test')), 'test-description'); @@ -72,14 +72,10 @@ } $ret = GalleryCoreApi::registerToolkitOperation('ItemEditPhotoPluginTestToolkit', - array('test/file'), - 'resize', - array(array('type' => 'int', - 'description' => 'test'), - array('type' => 'int', - 'description' => 'test')), - 'test-description', - ''); + array('test/file'), 'resize', + array(array('type' => 'int', 'description' => 'test'), + array('type' => 'int', 'description' => 'test')), + 'test-description', ''); if ($ret->isError()) { return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } @@ -105,7 +101,7 @@ list ($ret, $this->_derivative[2]) = $this->_createDerivative($this->_item, $this->_derivative[0]->getId(), - DERIVATIVE_TYPE_IMAGE_RESIZE, 'resize|500,500', 'test/file', + DERIVATIVE_TYPE_IMAGE_RESIZE, 'scale|500,500', 'test/file', array('postFilterOperations' => 'test-operation|0')); if ($ret->isError()) { return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); @@ -170,7 +166,7 @@ $this->assertEquals(3, sizeof($resizeTable[$this->_item->getId()])); for ($i = 0; $i < 3; $i++) { $this->assertEquals( - ($i < 2) ? ('resize|' . 100 * ($i+1) . ',' . 100 * ($i+1)) : 'resize|300,600', + ($i < 2) ? ('scale|' . 100 * ($i+1) . ',' . 100 * ($i+1)) : 'scale|300,600', $resizeTable[$this->_item->getId()][$i]->getDerivativeOperations()); // check that postfilteroperations are maintained and added to new resizes.. $this->assertEquals('test-operation|0', Index: ItemMakeHighlightControllerTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/test/phpunit/ItemMakeHighlightControllerTest.class,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ItemMakeHighlightControllerTest.class 21 Aug 2004 07:50:04 -0000 1.15 +++ ItemMakeHighlightControllerTest.class 30 Dec 2004 23:10:23 -0000 1.16 @@ -50,10 +50,10 @@ /* Register operations that we can perform on our mock data items */ $ret = GalleryCoreApi::registerToolkitOperation('ItemMakeHighlightTestToolkit', - array('test/file-0'), - 'thumbnail', - array(array('type' => 'int', 'description' => 'foo')), - 'test-description'); + array('test/file-0'), 'thumbnail', + array(array('type' => 'int', 'description' => 'foo'), + array('type' => 'int', 'description' => 'foo')), + 'test-description'); if ($ret->isError()) { print $gallery->getDebugBuffer(); print $ret->getAsHtml(); Index: AlbumTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/test/phpunit/AlbumTest.class,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- AlbumTest.class 30 Nov 2004 18:38:10 -0000 1.23 +++ AlbumTest.class 30 Dec 2004 23:10:22 -0000 1.24 @@ -55,11 +55,10 @@ /* Register operations that we can perform on our mock data items */ $ret = GalleryCoreApi::registerToolkitOperation('AlbumTestToolkit', - array('test/file'), - 'thumbnail', - array(array('type' => 'int', 'description' => 'test')), - 'test-description', - ''); + array('test/file'), 'thumbnail', + array(array('type' => 'int', 'description' => 'test'), + array('type' => 'int', 'description' => 'test')), + 'test-description', ''); if ($ret->isError()) { return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); } Index: CreateThumbnailOptionTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/test/phpunit/CreateThumbnailOptionTest.class,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CreateThumbnailOptionTest.class 24 Dec 2004 19:20:15 -0000 1.2 +++ CreateThumbnailOptionTest.class 30 Dec 2004 23:10:22 -0000 1.3 @@ -58,11 +58,10 @@ /* Register operations that we can perform on our mock data items */ $ret = GalleryCoreApi::registerToolkitOperation('CreateThumbnailOptionTestToolkit', - array('test/file'), - 'thumbnail', - array(array('type' => 'int', 'description' => 'test')), - 'test-description', - ''); + array('test/file'), 'thumbnail', + array(array('type' => 'int', 'description' => 'test'), + array('type' => 'int', 'description' => 'test')), + 'test-description', ''); list ($ret, $this->_item) = $this->_createRandomDataItem($this->_album->getId(), 'test/file'); if ($ret->isError()) { |