From 7f95ad7c2a2e71da6721517975ca537bd353ae45 Mon Sep 17 00:00:00 2001 From: Charles Farmer Date: Fri, 16 Feb 2018 16:53:28 -0500 Subject: [PATCH] Bug 17674 - Adapting Serials.t to the namespace change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Séverine QUEUNE --- t/db_dependent/Serials.t | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t index d5f4996..1192cd1 100755 --- a/t/db_dependent/Serials.t +++ b/t/db_dependent/Serials.t @@ -18,7 +18,7 @@ use Koha::DateUtils; use Koha::Acquisition::Booksellers; use Koha::Serials; use t::lib::Mocks; -use Test::More tests => 50; +use Test::More tests => 49; use t::lib::TestBuilder; BEGIN { @@ -354,29 +354,30 @@ subtest "Do not generate an expected if one already exists" => sub { subtest "Test GetSerialItemsInformations " => sub { plan tests => 4; - is (C4::Serials::GetSerialItemsInformations(),0,"test GetSerialItemsInformation with nothing parameters "); + is (Koha::Serials::GetSerialItemsInformations(),0,"test GetSerialItemsInformation with nothing parameters "); my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode }; my $itemtype = $builder->build({ source => 'Itemtype' })->{ itemtype }; + my ($biblionumber1, $bibitemnumber) = AddBiblio(MARC::Record->new, ''); my %item_infos = ( homebranch => $branchcode, holdingbranch => $branchcode, - itype => $itemtype + itype => $itemtype, + biblioitemnumber => $bibitemnumber, ); - my $biblionumber1 = AddBiblio(MARC::Record->new, ''); my $itemnumber1 = AddItem({ barcode => '0101', %item_infos }, $biblionumber1); my $itemnumber2 = AddItem({ barcode => '0102', %item_infos }, $biblionumber1); my $itemnumber3 = AddItem({ barcode => '0103', %item_infos }, $biblionumber1); my $itemnumber4 = AddItem({ barcode => '0104', %item_infos }, $biblionumber1); my @serialid = ($serials[0]->{serialid},$serials[1]->{serialid}); - is (C4::Serials::GetSerialItemsInformations(@serialid),0,"test GetSerialItemsInformation with array of serialid and none have items"); + is (Koha::Serials::GetSerialItemsInformations(@serialid),0,"test GetSerialItemsInformation with array of serialid and none have items"); subtest "Test with 2 serials and each have one item" => sub { plan tests => 5; AddItem2Serial($serialid[0],$itemnumber1); - my @result = C4::Serials::GetSerialItemsInformations(@serialid); + my @result = Koha::Serials::GetSerialItemsInformations(@serialid); is (scalar @result, 1 , "GetSerialItemsInformation return right length of array using 1 serial with 1 item"); is ($result[0]->{countitems}, 1 , "GetSerialItemsInformation return right number items of serial1"); AddItem2Serial($serialid[1],$itemnumber3); - @result = C4::Serials::GetSerialItemsInformations(@serialid); + @result = Koha::Serials::GetSerialItemsInformations(@serialid); is (scalar @result, 2 , "GetSerialItemsInformation return right length of array using 2 serials and each have 1 item"); is ($result[0]->{countitems}, 1 , "GetSerialItemsInformation return right number items of serial1"); is ($result[1]->{countitems}, 1 , "GetSerialItemsInformation return right number items of serial2"); @@ -384,12 +385,12 @@ subtest "Test GetSerialItemsInformations " => sub { subtest "Test with 2 serials and each have 2 items" => sub { plan tests => 6; AddItem2Serial($serialid[0],$itemnumber2); - my @result = C4::Serials::GetSerialItemsInformations(@serialid); + my @result = Koha::Serials::GetSerialItemsInformations(@serialid); is (scalar @result, 2 , "GetSerialItemsInformation return right length of array using 2 serials "); is ($result[0]->{countitems}, 2 , "GetSerialItemsInformation return right number items of serial1"); is ($result[1]->{countitems}, 1 , "GetSerialItemsInformation return right number items of serial2"); AddItem2Serial($serialid[1],$itemnumber4); - @result = C4::Serials::GetSerialItemsInformations(@serialid); + @result = Koha::Serials::GetSerialItemsInformations(@serialid); is (scalar @result, 2 , "GetSerialItemsInformation return right length of array using 2 serials and each have 2 items "); is ($result[0]->{countitems}, 2 , "GetSerialItemsInformation return right number items of serial1"); is ($result[1]->{countitems}, 2 , "GetSerialItemsInformation return right number items of serial2"); -- 2.1.4