]> git.donarmstrong.com Git - deb_pkgs/libapache-gallery-perl.git/blob - t/006_thumbnails.t
Add changes from 1.0.2-3
[deb_pkgs/libapache-gallery-perl.git] / t / 006_thumbnails.t
1 use Apache::Gallery;
2 use Test::More;
3
4 eval { require Test::MockObject; };
5 if ($@) {
6         plan skip_all => 'skip because Test::MockObject not found';
7 }
8 else {
9
10         plan tests => 4;
11
12         my $r = Test::MockObject->new();
13
14         $r->set_always('dir_config', '100x75');
15
16         my ($width, $height) = Apache::Gallery::get_thumbnailsize($r, 640, 480);
17         is ($width, 100, 'Width');
18         is ($height, 75, 'Height');
19
20         ($width, $height) = Apache::Gallery::get_thumbnailsize($r, 480, 640);
21         is ($width, 56, 'Height rotated');
22         is ($height, 75, 'Width rotated');
23
24 }