From 0b34e7e2a5a7373647a134a18bf8a27ca4433760 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 26 Feb 2019 17:23:13 -0300 Subject: [PATCH] Bug 22368: Make sure the tests will always pass Who knows! Signed-off-by: Jonathan Druart --- t/db_dependent/Koha/Suggestions.t | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/Koha/Suggestions.t b/t/db_dependent/Koha/Suggestions.t index 109488758a..480c387cb2 100644 --- a/t/db_dependent/Koha/Suggestions.t +++ b/t/db_dependent/Koha/Suggestions.t @@ -105,6 +105,7 @@ subtest 'constraints' => sub { } ); + my $nonexistent_borrowernumber = $patron->borrowernumber; # suggestedby $patron->delete; $suggestion = $suggestion->get_from_storage; @@ -124,7 +125,7 @@ subtest 'constraints' => sub { "The suggestion is not deleted when the related branch is deleted" ); # managerid - throws_ok { $suggestion->managedby(1029384756)->store; } + throws_ok { $suggestion->managedby($nonexistent_borrowernumber)->store; } 'Koha::Exceptions::Object::FKConstraint', 'store raises an exception on invalid managerid'; my $manager = $builder->build_object( { class => "Koha::Patrons" } ); @@ -135,7 +136,7 @@ subtest 'constraints' => sub { "The suggestion is not deleted when the related manager is deleted" ); # acceptedby - throws_ok { $suggestion->acceptedby(1029384756)->store; } + throws_ok { $suggestion->acceptedby($nonexistent_borrowernumber)->store; } 'Koha::Exceptions::Object::FKConstraint', 'store raises an exception on invalid acceptedby id'; my $acceptor = $builder->build_object( { class => "Koha::Patrons" } ); @@ -146,7 +147,7 @@ subtest 'constraints' => sub { "The suggestion is not deleted when the related acceptor is deleted" ); # rejectedby - throws_ok { $suggestion->rejectedby(1029384756)->store; } + throws_ok { $suggestion->rejectedby($nonexistent_borrowernumber)->store; } 'Koha::Exceptions::Object::FKConstraint', 'store raises an exception on invalid rejectedby id'; my $rejecter = $builder->build_object( { class => "Koha::Patrons" } ); @@ -157,7 +158,7 @@ subtest 'constraints' => sub { "The suggestion is not deleted when the related rejecter is deleted" ); # budgetid - throws_ok { $suggestion->budgetid(1029384756)->store; } + throws_ok { $suggestion->budgetid($nonexistent_borrowernumber)->store; } 'Koha::Exceptions::Object::FKConstraint', 'store raises an exception on invalid budgetid'; my $fund = $builder->build_object( { class => "Koha::Acquisition::Funds" } ); -- 2.11.0