Merge commit '808a866c8b' into webgui8. 7.9.4 release point
Conflicts: docs/upgrades/packages-7.9.3/root_import_gallery-templates_default-gallery-edit-album.wgpkg docs/upgrades/upgrade_7.9.2-7.9.3.pl lib/WebGUI.pm lib/WebGUI/Asset/MapPoint.pm lib/WebGUI/Asset/Wobject/Calendar.pm lib/WebGUI/Asset/Wobject/Gallery.pm lib/WebGUI/Asset/Wobject/GalleryAlbum.pm lib/WebGUI/Asset/Wobject/WikiMaster.pm lib/WebGUI/AssetClipboard.pm lib/WebGUI/AssetVersioning.pm lib/WebGUI/Auth.pm t/Asset/Asset.t
This commit is contained in:
commit
b30491f3a6
31 changed files with 1974 additions and 415 deletions
|
|
@ -65,7 +65,7 @@ my $extensionTests = [
|
|||
},
|
||||
];
|
||||
|
||||
plan tests => 49 + scalar @{ $extensionTests }; # increment this value for each test you create
|
||||
plan tests => 54 + scalar @{ $extensionTests }; # increment this value for each test you create
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
|
|
@ -276,6 +276,40 @@ foreach my $testImage (@testImages) {
|
|||
|
||||
});
|
||||
|
||||
####################################################
|
||||
#
|
||||
# rotate
|
||||
#
|
||||
####################################################
|
||||
|
||||
my $rotateTest = WebGUI::Storage->create( $session );
|
||||
WebGUI::Test->storagesToDelete($rotateTest);
|
||||
|
||||
# Add test image to the storage
|
||||
ok( $rotateTest->addFileFromFilesystem(WebGUI::Test->getTestCollateralPath("rotation_test.png")), "Can add test image to storage" );
|
||||
|
||||
# Rotate test image by 90° CW
|
||||
my $file = $rotateTest->getFiles->[0];
|
||||
$rotateTest->rotate($file, 90);
|
||||
# Check dimensions
|
||||
cmp_bag( [$rotateTest->getSizeInPixels( $file )], [2,3], "Check size of photo after rotating 90° CW" );
|
||||
# Check pixels
|
||||
my $image = Image::Magick->new;
|
||||
$image->Read( $rotateTest->getPath($file) );
|
||||
is( $image->GetPixel(x=>2, y=>0), 0, "Pixel at location [2,0] should be black" );
|
||||
|
||||
# Rotate test image by 90° CCW
|
||||
my $file = $rotateTest->getFiles->[0];
|
||||
$rotateTest->rotate($file, -90);
|
||||
# Check dimensions
|
||||
cmp_bag( [$rotateTest->getSizeInPixels( $file )], [3,2], "Check size of photo after rotating 90° CCW" );
|
||||
# Check pixels
|
||||
$image = Image::Magick->new;
|
||||
$image->Read( $rotateTest->getPath($file) );
|
||||
is( $image->GetPixel(x=>0, y=>0), 0, "Pixel at location [0,0] should be black" );
|
||||
|
||||
|
||||
|
||||
TODO: {
|
||||
local $TODO = "Methods that need to be tested";
|
||||
ok(0, 'resize');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue