File: 006_thumbnails.t

package info (click to toggle)
libapache-gallery-perl 0.99-svn060811-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, squeeze
  • size: 536 kB
  • ctags: 24
  • sloc: perl: 1,128; makefile: 60; sh: 13
file content (24 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (7)
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');

}