File: 006_thumbnails.t

package info (click to toggle)
libapache-gallery-perl 1.0.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,260 kB
  • sloc: perl: 1,281; sh: 21; makefile: 13
file content (24 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use Apache::Gallery;
use Test::More;

eval { require Test::MockObject; };
if ($@) {
	plan skip_all => 'skip because Test::MockObject not found';
}
else {

	plan tests => 4;

	my $r = Test::MockObject->new();

	$r->set_always('dir_config', '100x75');

	my ($width, $height) = Apache::Gallery::get_thumbnailsize($r, 640, 480);
	is ($width, 100, 'Width');
	is ($height, 75, 'Height');

	($width, $height) = Apache::Gallery::get_thumbnailsize($r, 480, 640);
	is ($width, 56, 'Height rotated');
	is ($height, 75, 'Width rotated');

}