From 83bb93ccc96b69739900af559c5112602bc13490 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 15 Oct 2020 11:33:33 -0300 Subject: [PATCH] Bug 26582: (QA follow-up) Rename closed => is_closed Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- Koha/Acquisition/Basket.pm | 8 ++++---- t/db_dependent/Koha/Acquisition/Basket.t | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Koha/Acquisition/Basket.pm b/Koha/Acquisition/Basket.pm index 6cfa64c76f..35255bee4b 100644 --- a/Koha/Acquisition/Basket.pm +++ b/Koha/Acquisition/Basket.pm @@ -156,15 +156,15 @@ sub authorizer { return scalar Koha::Patrons->find($self->authorisedby); } -=head3 closed +=head3 is_closed - if ( $basket->closed ) { ... } + if ( $basket->is_closed ) { ... } Returns a boolean value representing if the basket is closed. =cut -sub closed { +sub is_closed { my ($self) = @_; return ($self->closedate) ? 1 : 0; @@ -185,7 +185,7 @@ sub close { my ($self) = @_; Koha::Exceptions::Acquisition::Basket::AlreadyClosed->throw - if $self->closed; + if $self->is_closed; $self->_result->result_source->schema->txn_do( sub { diff --git a/t/db_dependent/Koha/Acquisition/Basket.t b/t/db_dependent/Koha/Acquisition/Basket.t index 0570e244d4..c8819457a9 100755 --- a/t/db_dependent/Koha/Acquisition/Basket.t +++ b/t/db_dependent/Koha/Acquisition/Basket.t @@ -303,7 +303,7 @@ subtest 'orders' => sub { $schema->storage->txn_rollback; }; -subtest 'closed() tests' => sub { +subtest 'is_closed() tests' => sub { plan tests => 2; @@ -327,8 +327,8 @@ subtest 'closed() tests' => sub { } ); - ok( $closed_basket->closed, 'Closed basket is tested as closed' ); - ok( !$open_basket->closed, 'Open basket is tested as open' ); + ok( $closed_basket->is_closed, 'Closed basket is tested as closed' ); + ok( !$open_basket->is_closed, 'Open basket is tested as open' ); $schema->storage->txn_rollback; }; @@ -363,7 +363,7 @@ subtest 'close() tests' => sub { $basket->close; - ok( $basket->closed, 'Basket is closed' ); + ok( $basket->is_closed, 'Basket is closed' ); my $ordered_orders = $basket->orders->search({ orderstatus => 'ordered' }); is( $ordered_orders->count, 3, 'Only open orders have been marked as ordered' ); -- 2.39.5