From: Pierre-Luc P. <pa...@us...> - 2005-07-30 13:26:34
|
Update of /cvsroot/gallery/gallery2/modules/remote/test/phpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26406/modules/remote/test/phpunit Modified Files: GalleryRemoteControllerTest.class Log Message: Added support for album-properties, so GR can auto-resize images before uploading them. Index: GalleryRemoteControllerTest.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/remote/test/phpunit/GalleryRemoteControllerTest.class,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- GalleryRemoteControllerTest.class 29 Jul 2005 23:18:13 -0000 1.18 +++ GalleryRemoteControllerTest.class 30 Jul 2005 13:26:23 -0000 1.19 @@ -397,7 +397,7 @@ $response = $results['status']['controllerResponse']; $this->assertEquals($this->_code['SUCCESS'], (int)$response->getProperty('status')); - /* Make sure the there are no images */ + /* Make sure the there are 2 images */ $this->assertEquals('2', $response->getProperty('image_count')); $this->assert($response->hasProperty('status_text')); } @@ -416,6 +416,29 @@ $this->assertEquals($this->_code['SUCCESS'], (int)$response->getProperty('status')); $this->assert($response->hasProperty('status_text')); } + + function testAlbumProperties() { + global $gallery; + + /* Set the preferences */ + $ret = GalleryCoreApi::addDerivativePreference( + 1, $this->_rootAlbum->getId(), DERIVATIVE_TYPE_IMAGE_RESIZE, 'scale|640,640'); + if ($ret->isError()) { + return $this->failWithStatus($ret->wrap(__FILE__, __LINE__)); + } + + GalleryUtilities::putRequestVariable('form[cmd]', 'album-properties'); + GalleryUtilities::putRequestVariable('form[set_albumName]', $this->_rootAlbum->getId()); + $results = $this->handleRequest(); + $this->assertEquals(array(), $results['error']); + $this->assertEquals('remote.GalleryRemote', $results['delegate']['view']); + + $response = $results['status']['controllerResponse']; + $this->assertEquals($this->_code['SUCCESS'], (int)$response->getProperty('status')); + + $this->assertEquals('640', $response->getProperty('auto_resize')); + $this->assert($response->hasProperty('status_text')); + } } class GalleryRemoteControllerTestAddOption { |