Browse Source

Bug 21133: Fix use statements order

Basically the idea is:
1. Undefined subroutine &C4::Items::ModZebra called at /home/vagrant/kohaclone/C4/Items.pm line 302.

=> Then use C4::Items before C4::Biblio

2. Undefined subroutine &C4::Circulation::GetItem called at /home/vagrant/kohaclone/C4/Circulation.pm line 1290

=> Then use C4::Circulation before C4::Items

And sometimes these 2 rules do not work...

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18.11.x
Jonathan Druart 5 years ago
committed by Tomas Cohen Arazi
parent
commit
ce96080f30
  1. 2
      t/db_dependent/Circulation/Branch.t
  2. 2
      t/db_dependent/Circulation/Chargelostitem.t
  3. 9
      t/db_dependent/Circulation/CheckIfIssuedToPatron.t
  4. 2
      t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t
  5. 2
      t/db_dependent/Circulation/IsItemIssued.t
  6. 2
      t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t
  7. 4
      t/db_dependent/Circulation/Returns.t
  8. 4
      t/db_dependent/Circulation/SwitchOnSiteCheckouts.t
  9. 4
      t/db_dependent/Circulation/TooMany.t
  10. 4
      t/db_dependent/Circulation/issue.t
  11. 4
      t/db_dependent/Circulation/transfers.t
  12. 4
      t/db_dependent/CourseReserves.t
  13. 9
      t/db_dependent/Holds.t
  14. 2
      t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
  15. 3
      t/db_dependent/Holds/LocalHoldsPriority.t
  16. 12
      t/db_dependent/Holds/RevertWaitingStatus.t
  17. 9
      t/db_dependent/Items.t
  18. 2
      t/db_dependent/Items/AutomaticItemModificationByAge.t
  19. 7
      t/db_dependent/Items/DelItem.t
  20. 2
      t/db_dependent/Koha/Biblios.t
  21. 3
      t/db_dependent/Koha/Object.t
  22. 4
      t/db_dependent/Koha/Patrons.t
  23. 2
      t/db_dependent/Labels/t_Batch.t
  24. 2
      t/db_dependent/Members/GetAllIssues.t
  25. 2
      t/db_dependent/Members/IssueSlip.t
  26. 4
      t/db_dependent/Patron/Borrower_Discharge.t
  27. 2
      t/db_dependent/Reserves.t
  28. 4
      t/db_dependent/RotatingCollections.t
  29. 2
      t/db_dependent/ShelfBrowser.t
  30. 2
      t/db_dependent/api/v1/holds.t

2
t/db_dependent/Circulation/Branch.t

@ -17,9 +17,9 @@
use Modern::Perl;
use C4::Biblio;
use C4::Circulation;
use C4::Items;
use C4::Biblio;
use C4::Context;
use Koha::Patrons;

2
t/db_dependent/Circulation/Chargelostitem.t

@ -7,9 +7,9 @@ use Test::MockModule;
use t::lib::Mocks;
use t::lib::TestBuilder;
use C4::Circulation;
use C4::Biblio;
use C4::Items;
use C4::Circulation;
use Koha::Patrons;
use MARC::Record;

9
t/db_dependent/Circulation/CheckIfIssuedToPatron.t

@ -17,20 +17,17 @@
use Modern::Perl;
use Test::More tests => 22;
use Test::More tests => 21;
use Test::MockModule;
use t::lib::TestBuilder;
use C4::Biblio;
use C4::Circulation;
use C4::Items;
use C4::Biblio;
use Koha::Library;
use Koha::Patrons;
use MARC::Record;
BEGIN {
use_ok('C4::Circulation');
}
my $schema = Koha::Database->schema;
$schema->storage->txn_begin;

2
t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t

@ -21,8 +21,8 @@ use Test::More tests => 2;
use Test::MockModule;
use t::lib::TestBuilder;
use C4::Biblio;
use C4::Circulation;
use C4::Biblio;
use C4::Items;
use C4::Members;

2
t/db_dependent/Circulation/IsItemIssued.t

@ -20,9 +20,9 @@ use Modern::Perl;
use Test::More tests => 5;
use Test::MockModule;
use C4::Biblio;
use C4::Circulation;
use C4::Items;
use C4::Biblio;
use Koha::Database;
use Koha::DateUtils;
use Koha::Patrons;

2
t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t

@ -5,9 +5,9 @@ use MARC::Record;
use MARC::Field;
use C4::Context;
use C4::Biblio qw( AddBiblio );
use C4::Circulation qw( AddIssue AddReturn );
use C4::Items qw( AddItem );
use C4::Biblio qw( AddBiblio );
use Koha::Database;
use Koha::DateUtils;
use Koha::Patron::Debarments qw( GetDebarments DelDebarment );

4
t/db_dependent/Circulation/Returns.t

@ -24,10 +24,10 @@ use Test::Warn;
use t::lib::Mocks;
use t::lib::TestBuilder;
use C4::Biblio;
use C4::Members;
use C4::Circulation;
use C4::Items;
use C4::Members;
use C4::Biblio;
use Koha::Database;
use Koha::Account::Lines;
use Koha::DateUtils;

4
t/db_dependent/Circulation/SwitchOnSiteCheckouts.t

@ -18,10 +18,10 @@ use Modern::Perl;
use Test::More tests => 10;
use C4::Context;
use C4::Biblio;
use C4::Members;
use C4::Circulation;
use C4::Biblio;
use C4::Items;
use C4::Members;
use C4::Context;
use Koha::DateUtils qw( dt_from_string );

4
t/db_dependent/Circulation/TooMany.t

@ -18,10 +18,10 @@ use Modern::Perl;
use Test::More tests => 7;
use C4::Context;
use C4::Biblio;
use C4::Members;
use C4::Circulation;
use C4::Items;
use C4::Biblio;
use C4::Circulation;
use C4::Context;
use Koha::DateUtils qw( dt_from_string );

4
t/db_dependent/Circulation/issue.t

@ -23,10 +23,10 @@ use DateTime::Duration;
use t::lib::Mocks;
use t::lib::TestBuilder;
use C4::Biblio;
use C4::Circulation;
use C4::Context;
use C4::Items;
use C4::Biblio;
use C4::Context;
use C4::Reserves;
use Koha::Checkouts;
use Koha::Database;

4
t/db_dependent/Circulation/transfers.t

@ -16,10 +16,10 @@
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use C4::Biblio;
use C4::Context;
use C4::Items;
use C4::Circulation;
use C4::Biblio;
use C4::Items;
use Koha::Database;
use Koha::DateUtils;
use DateTime::Duration;

4
t/db_dependent/CourseReserves.t

@ -23,10 +23,10 @@ use Koha::Database;
use t::lib::TestBuilder;
BEGIN {
use_ok('C4::Items', qw(AddItem));
use_ok('C4::Biblio');
use_ok('C4::Context');
use_ok('C4::CourseReserves', qw/:all/);
use_ok('C4::Items', qw(AddItem));
use_ok('C4::Context');
use_ok('MARC::Field');
use_ok('MARC::Record');
}

9
t/db_dependent/Holds.t

@ -7,21 +7,22 @@ use t::lib::TestBuilder;
use C4::Context;
use Test::More tests => 55;
use Test::More tests => 54;
use MARC::Record;
use C4::Biblio;
use Koha::Patrons;
use C4::Items;
use C4::Biblio;
use C4::Reserves;
use C4::Calendar;
use Koha::Database;
use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::Biblios;
use Koha::Holds;
use Koha::Patrons;
BEGIN {
use FindBin;
use lib $FindBin::Bin;
use_ok('C4::Reserves');
}
my $schema = Koha::Database->new->schema;

2
t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t

@ -3,8 +3,8 @@
use Modern::Perl;
use C4::Context;
use C4::Items;
use C4::Circulation;
use C4::Items;
use Koha::IssuingRule;
use Test::More tests => 6;

3
t/db_dependent/Holds/LocalHoldsPriority.t

@ -7,10 +7,11 @@ use C4::Context;
use Test::More tests => 6;
use MARC::Record;
use Koha::Patrons;
use C4::Biblio;
use C4::Items;
use Koha::Database;
use Koha::Patrons;
use t::lib::TestBuilder;

12
t/db_dependent/Holds/RevertWaitingStatus.t

@ -16,20 +16,18 @@
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use t::lib::Mocks;
use C4::Context;
use Test::More tests => 3;
use MARC::Record;
use C4::Biblio;
use C4::Items;
use C4::Reserves;
use Koha::Libraries;
use Koha::Patrons;
use C4::Context;
use C4::Items;
use C4::Biblio;
use C4::Reserves;
use t::lib::TestBuilder;
use t::lib::Mocks;
my $schema = Koha::Database->schema;
$schema->storage->txn_begin;

9
t/db_dependent/Items.t

@ -20,7 +20,9 @@ use Modern::Perl;
use Data::Dumper;
use MARC::Record;
use C4::Items;
use C4::Biblio;
use Koha::Items;
use Koha::Database;
use Koha::DateUtils qw( dt_from_string );
use Koha::Library;
@ -31,15 +33,10 @@ use Koha::Caches;
use t::lib::Mocks;
use t::lib::TestBuilder;
use Test::More tests => 14;
use Test::More tests => 12;
use Test::Warn;
BEGIN {
use_ok('C4::Items');
use_ok('Koha::Items');
}
my $schema = Koha::Database->new->schema;
my $location = 'My Location';

2
t/db_dependent/Items/AutomaticItemModificationByAge.t

@ -7,9 +7,9 @@ use MARC::Field;
use DateTime;
use DateTime::Duration;
use C4::Items;
use C4::Biblio;
use C4::Context;
use C4::Items;
use Koha::DateUtils;
use t::lib::TestBuilder;

7
t/db_dependent/Items/DelItem.t

@ -1,15 +1,12 @@
use Modern::Perl;
use MARC::Record;
use C4::Items;
use C4::Biblio;
use t::lib::TestBuilder;
use Test::More tests => 7;
BEGIN {
use_ok('C4::Items');
}
use Test::More tests => 6;
my $schema = Koha::Database->schema;
$schema->storage->txn_begin;

2
t/db_dependent/Koha/Biblios.t

@ -22,8 +22,8 @@ use Modern::Perl;
use Test::More tests => 5;
use Test::Exception;
use C4::Biblio;
use C4::Items;
use C4::Biblio;
use C4::Reserves;
use Koha::DateUtils qw( dt_from_string output_pref );

3
t/db_dependent/Koha/Object.t

@ -23,8 +23,9 @@ use Test::Warn;
use DateTime;
use C4::Context;
use C4::Biblio; # AddBiblio
use C4::Circulation; # AddIssue
use C4::Biblio; # AddBiblio
use Koha::Database;
use Koha::DateUtils qw( dt_from_string );
use Koha::Libraries;

4
t/db_dependent/Koha/Patrons.t

@ -26,10 +26,8 @@ use Time::Fake;
use DateTime;
use JSON;
use C4::Biblio;
use C4::Circulation;
use C4::Circulation;
use C4::Biblio;
use Koha::Holds;
use Koha::Patrons;

2
t/db_dependent/Labels/t_Batch.t

@ -27,8 +27,8 @@ use MARC::Field;
use t::lib::TestBuilder;
use C4::Context;
use C4::Biblio;
use C4::Items;
use C4::Biblio;
use Koha::Libraries;
BEGIN {

2
t/db_dependent/Members/GetAllIssues.t

@ -22,10 +22,10 @@ use Test::MockModule;
use t::lib::TestBuilder;
use C4::Circulation;
use C4::Biblio;
use C4::Items;
use C4::Members;
use C4::Circulation;
use Koha::Libraries;
use Koha::Patrons;
use MARC::Record;

2
t/db_dependent/Members/IssueSlip.t

@ -24,10 +24,10 @@ use Test::MockModule;
use Test::MockTime qw( set_fixed_time );
use t::lib::TestBuilder;
use C4::Circulation;
use C4::Biblio;
use C4::Items;
use C4::Members;
use C4::Circulation;
use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::Library;

4
t/db_dependent/Patron/Borrower_Discharge.t

@ -19,10 +19,10 @@ use Test::More tests => 19;
use Test::Warn;
use MARC::Record;
use C4::Biblio qw( AddBiblio );
use C4::Circulation qw( AddIssue AddReturn );
use C4::Context;
use C4::Items qw( AddItem );
use C4::Biblio qw( AddBiblio );
use C4::Context;
use Koha::Patrons;
use Koha::Patron::Discharge;

2
t/db_dependent/Reserves.t

@ -27,9 +27,9 @@ use t::lib::TestBuilder;
use MARC::Record;
use DateTime::Duration;
use C4::Biblio;
use C4::Circulation;
use C4::Items;
use C4::Biblio;
use C4::Members;
use C4::Reserves;
use Koha::Caches;

4
t/db_dependent/RotatingCollections.t

@ -17,13 +17,13 @@
use Modern::Perl;
use Test::More tests => 52;
use Test::More tests => 51;
use C4::Context;
use C4::RotatingCollections;
use C4::Biblio;
use Koha::Library;
BEGIN {
use_ok('C4::RotatingCollections');
}
can_ok(

2
t/db_dependent/ShelfBrowser.t

@ -6,9 +6,9 @@ use List::Util qw( shuffle );
use MARC::Field;
use MARC::Record;
use C4::Biblio;
use C4::Context;
use C4::Items;
use C4::Biblio;
use Koha::Database;
use t::lib::TestBuilder;

2
t/db_dependent/api/v1/holds.t

@ -25,6 +25,7 @@ use t::lib::Mocks;
use DateTime;
use C4::Context;
use Koha::Patrons;
use C4::Reserves;
use C4::Items;
@ -33,7 +34,6 @@ use Koha::DateUtils;
use Koha::Biblios;
use Koha::Biblioitems;
use Koha::Items;
use Koha::Patrons;
my $schema = Koha::Database->new->schema;
my $builder = t::lib::TestBuilder->new();

Loading…
Cancel
Save