From afa5b0e8d0135cda5688b2d0d2f73da898db6653 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 --- 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 6cfa64c76fc..35255bee4b2 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 0570e244d4a..c8819457a91 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.28.0