From 5f867fbb4bcdbebe41797153f7fa0232a886da57 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 20 Mar 2019 00:50:45 +0000 Subject: [PATCH] Bug 21987: (RMaint followup) fix bad test Signed-off-by: Lucas Gass --- t/db_dependent/Images.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Images.t b/t/db_dependent/Images.t index a7063c8b5f..caa057aeab 100644 --- a/t/db_dependent/Images.t +++ b/t/db_dependent/Images.t @@ -9,7 +9,7 @@ my $schema = Koha::Database->schema; $schema->storage->txn_begin(); my $builder = t::lib::TestBuilder->new; -my $biblio = $builder->build_sample_biblio; +my $biblionumber = $builder->build({source=>'Biblio'})->{biblionumber}; my $path = 'koha-tmpl/intranet-tmpl/prog/img/koha-logo.png'; my $koha_logo = GD::Image->new($path); @@ -17,9 +17,9 @@ my $koha_logo = GD::Image->new($path); { # True color == 0 $koha_logo->trueColor(0); - C4::Images::PutImage( $biblio->biblionumber, $koha_logo ); + C4::Images::PutImage( $biblionumber, $koha_logo ); - my @imagenumbers = C4::Images::ListImagesForBiblio( $biblio->biblionumber ); + my @imagenumbers = C4::Images::ListImagesForBiblio( $biblionumber ); is( scalar(@imagenumbers), 1, "The image has been added to the biblio" ); my $image = C4::Images::RetrieveImage($imagenumbers[0]); ok( length $image->{thumbnail} < length $image->{imagefile}, 'thumbnail should be shorter than the original image' ); @@ -29,9 +29,9 @@ my $koha_logo = GD::Image->new($path); # True color == 1 # Note that we are cheating here, the original file is not a true color image $koha_logo->trueColor(1); - C4::Images::PutImage( $biblio->biblionumber, $koha_logo, 'replace' ); + C4::Images::PutImage( $biblionumber, $koha_logo, 'replace' ); - my @imagenumbers = C4::Images::ListImagesForBiblio( $biblio->biblionumber ); + my @imagenumbers = C4::Images::ListImagesForBiblio( $biblionumber ); is( scalar(@imagenumbers), 1 , "The image replaced the previous image on the biblio" ); my $image = C4::Images::RetrieveImage($imagenumbers[0]); ok( length $image->{thumbnail} > length $image->{imagefile}, 'thumbnail should be bigger than the original image.' ); -- 2.39.5