Bugzilla – Attachment 53188 Details for
Bug 16870
Koha::Issue(s) should be named Koha::Checkout(s)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16870 - Move and rename class files and unit tests
Bug-16870---Move-and-rename-class-files-and-unit-t.patch (text/plain), 3.45 KB, created by
Kyle M Hall (khall)
on 2016-07-07 16:14:59 UTC
(
hide
)
Description:
Bug 16870 - Move and rename class files and unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-07-07 16:14:59 UTC
Size:
3.45 KB
patch
obsolete
>From 45fd7b5ba4813b35f76c50ea69d9c8992e497a47 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 7 Jul 2016 14:30:53 +0000 >Subject: [PATCH] Bug 16870 - Move and rename class files and unit tests > >--- > Koha/{Issue.pm => Checkout.pm} | 2 +- > Koha/{Issues.pm => Checkouts.pm} | 6 +++--- > t/db_dependent/Koha/{Issues.t => Checkouts.t} | 16 ++++++++-------- > 3 files changed, 12 insertions(+), 12 deletions(-) > rename Koha/{Issue.pm => Checkout.pm} (97%) > rename Koha/{Issues.pm => Checkouts.pm} (91%) > rename t/db_dependent/Koha/{Issues.t => Checkouts.t} (78%) > >diff --git a/Koha/Issue.pm b/Koha/Checkout.pm >similarity index 97% >rename from Koha/Issue.pm >rename to Koha/Checkout.pm >index 8b67235..a2ebbc9 100644 >--- a/Koha/Issue.pm >+++ b/Koha/Checkout.pm >@@ -1,4 +1,4 @@ >-package Koha::Issue; >+package Koha::Checkout; > > # This file is part of Koha. > # >diff --git a/Koha/Issues.pm b/Koha/Checkouts.pm >similarity index 91% >rename from Koha/Issues.pm >rename to Koha/Checkouts.pm >index f0b2216..b19d1bc 100644 >--- a/Koha/Issues.pm >+++ b/Koha/Checkouts.pm >@@ -1,4 +1,4 @@ >-package Koha::Issues; >+package Koha::Checkouts; > > # This file is part of Koha. > # >@@ -18,7 +18,7 @@ package Koha::Issues; > use Modern::Perl; > > use Koha::Database; >-use Koha::Issue; >+use Koha::Checkout; > > use base qw(Koha::Objects); > >@@ -27,7 +27,7 @@ sub _type { > } > > sub object_class { >- return 'Koha::Issue'; >+ return 'Koha::Checkout'; > } > > 1; >diff --git a/t/db_dependent/Koha/Issues.t b/t/db_dependent/Koha/Checkouts.t >similarity index 78% >rename from t/db_dependent/Koha/Issues.t >rename to t/db_dependent/Koha/Checkouts.t >index 38023c8..30cdf9d 100644 >--- a/t/db_dependent/Koha/Issues.t >+++ b/t/db_dependent/Koha/Checkouts.t >@@ -21,8 +21,8 @@ use Modern::Perl; > > use Test::More tests => 4; > >-use Koha::Issue; >-use Koha::Issues; >+use Koha::Checkout; >+use Koha::Checkouts; > use Koha::Database; > > use t::lib::TestBuilder; >@@ -34,26 +34,26 @@ my $builder = t::lib::TestBuilder->new; > my $patron = $builder->build( { source => 'Borrower' } ); > my $item_1 = $builder->build( { source => 'Item' } ); > my $item_2 = $builder->build( { source => 'Item' } ); >-my $nb_of_issues = Koha::Issues->search->count; >-my $new_issue_1 = Koha::Issue->new( >+my $nb_of_issues = Koha::Checkouts->search->count; >+my $new_issue_1 = Koha::Checkout->new( > { borrowernumber => $patron->{borrowernumber}, > itemnumber => $item_1->{itemnumber}, > } > )->store; >-my $new_issue_2 = Koha::Issue->new( >+my $new_issue_2 = Koha::Checkout->new( > { borrowernumber => $patron->{borrowernumber}, > itemnumber => $item_2->{itemnumber}, > } > )->store; > > like( $new_issue_1->issue_id, qr|^\d+$|, 'Adding a new issue should have set the issue_id' ); >-is( Koha::Issues->search->count, $nb_of_issues + 2, 'The 2 issues should have been added' ); >+is( Koha::Checkouts->search->count, $nb_of_issues + 2, 'The 2 issues should have been added' ); > >-my $retrieved_issue_1 = Koha::Issues->find( $new_issue_1->issue_id ); >+my $retrieved_issue_1 = Koha::Checkouts->find( $new_issue_1->issue_id ); > is( $retrieved_issue_1->itemnumber, $new_issue_1->itemnumber, 'Find a issue by id should return the correct issue' ); > > $retrieved_issue_1->delete; >-is( Koha::Issues->search->count, $nb_of_issues + 1, 'Delete should delete the issue' ); >+is( Koha::Checkouts->search->count, $nb_of_issues + 1, 'Delete should delete the issue' ); > > $schema->storage->txn_rollback; > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16870
:
53188
|
53189
|
53373
|
53374
|
53375
|
53376
|
53407
|
53408