From 9011dd5196a8a71bdedafc2547faaf25461acf9c Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Thu, 12 Sep 2013 09:29:40 -0400 Subject: [PATCH] Bug 10402 follow-up: rebase onto latest master Because of the complexity of the rebase, I have chosen to correct a couple merge errors in a separate patch rather than squashing the corrections into the last patch in the patchset. This rebase patch does one thing that may not be completely obvious: in order to keep the existing tests matching their stated aims, it centralizes contact-related unit testing at the end of the Bookseller.t unit test, and removes contacts from earlier tests. --- C4/Bookseller.pm | 4 ++-- t/db_dependent/Bookseller.t | 43 ++++--------------------------------------- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/C4/Bookseller.pm b/C4/Bookseller.pm index 4386bb4..702b37c 100644 --- a/C4/Bookseller.pm +++ b/C4/Bookseller.pm @@ -248,7 +248,7 @@ sub ModBookseller { discount=?,notes=?,gstrate=?,deliverytime=? WHERE id=?'; my $sth = $dbh->prepare($query); - return $sth->execute( + my $cnt = $sth->execute( $data->{'name'}, $data->{'address1'}, $data->{'address2'}, $data->{'address3'}, $data->{'address4'}, $data->{'postal'}, @@ -278,7 +278,7 @@ sub ModBookseller { } $sth = $dbh->prepare($contactquery); $sth->execute(@contactparams); - return; + return $cnt; } =head2 DelBookseller diff --git a/t/db_dependent/Bookseller.t b/t/db_dependent/Bookseller.t index d1a0f1d..52feabf 100644 --- a/t/db_dependent/Bookseller.t +++ b/t/db_dependent/Bookseller.t @@ -2,7 +2,7 @@ use Modern::Perl; -use Test::More tests => 72; +use Test::More tests => 69; use C4::Context; use Koha::DateUtils; use DateTime::Duration; @@ -50,13 +50,6 @@ my $sample_supplier1 = { accountnumber => 'accountnumber1', fax => 'fax1', url => 'url1', - contact => 'contact1', - contpos => 'contpos1', - contphone => 'contphone1', - contfax => 'contefax1', - contaltphone => 'contaltphone1', - contemail => 'contemail1', - contnotes => 'contnotes1', active => 1, gstreg => 1, listincgst => 1, @@ -77,13 +70,6 @@ my $sample_supplier2 = { accountnumber => 'accountnumber2', fax => 'fax2', url => 'url2', - contact => 'contact2', - contpos => 'contpos2', - contphone => 'contphone2', - contfax => 'contefax2', - contaltphone => 'contaltphone2', - contemail => 'contemail2', - contnotes => 'contnotes2', active => 1, gstreg => 1, listincgst => 1, @@ -91,7 +77,7 @@ my $sample_supplier2 = { gstrate => '2.0000', discount => '2.0000', notes => 'notes2', - deliverytime => 2, + deliverytime => 2 }; my $id_supplier1 = C4::Bookseller::AddBookseller($sample_supplier1); @@ -231,13 +217,6 @@ $sample_supplier2 = { accountnumber => 'accountnumber2 modified', fax => 'fax2 modified', url => 'url2 modified', - contact => 'contact2 modified', - contpos => 'contpos2 modified', - contphone => 'contphone2 modified', - contfax => 'contefax2 modified', - contaltphone => 'contaltphone2 modified', - contemail => 'contemail2 modified', - contnotes => 'contnotes2 modified', active => 1, gstreg => 1, listincgst => 1, @@ -278,13 +257,6 @@ my $sample_supplier3 = { accountnumber => 'accountnumber3', fax => 'fax3', url => 'url3', - contact => 'contact3', - contpos => 'contpos3', - contphone => 'contphone3', - contfax => 'contefax3', - contaltphone => 'contaltphone3', - contemail => 'contemail3', - contnotes => 'contnotes3', active => 1, gstreg => 1, listincgst => 1, @@ -305,13 +277,6 @@ my $sample_supplier4 = { accountnumber => 'accountnumber4', fax => 'fax4', url => 'url4', - contact => 'contact4', - contpos => 'contpos4', - contphone => 'contphone4', - contfax => 'contefax4', - contaltphone => 'contaltphone4', - contemail => 'contemail4', - contnotes => 'contnotes4', active => 1, gstreg => 1, listincgst => 1, @@ -677,7 +642,7 @@ my $booksellerid = C4::Bookseller::AddBookseller( ] ); -my @booksellers = C4::Bookseller::GetBookSeller('my vendor'); +@booksellers = C4::Bookseller::GetBookSeller('my vendor'); ok( ( grep { $_->{'id'} == $booksellerid } @booksellers ), 'GetBookSeller returns correct record when passed a name' @@ -738,7 +703,7 @@ sub field_filter { 'bookselleremail', 'booksellerfax', 'booksellerurl', 'othersupplier', 'currency', 'invoiceprice', - 'listprice' + 'listprice', 'contacts' ) { -- 1.7.9.5