"Fossies" - the Fresh Open Source Software Archive

Member "Apache-Gallery-1.0.2/t/006_thumbnails.t" (8 Jun 2011, 529 Bytes) of package /linux/www/old/Apache-Gallery-1.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    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 }