@@ -, +, @@ --- t/Bookseller.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/t/Bookseller.t +++ a/t/Bookseller.t @@ -47,12 +47,12 @@ my $item1 = create('Item', $booksellerid1); my $subscription = create('Subscription', $booksellerid1); -my $bookseller = Koha::Acquisition::Bookseller->fetch({id => $booksellerid1}); +my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid1 ); -my ($error, $result) = $bookseller->merge_to(345876876); -is($error, "Unknown target bookseller number: 345876876", 'Merge to unknown bookseller return an error' ); +my $result = eval{ $bookseller->merge_with(345876876); }; +like($@, qr/Unknown target bookseller number: 345876876/, 'Merge with unknown bookseller should die.'); -($error, $result) = $bookseller->merge_to($booksellerid2); +$result = $bookseller->merge_with($booksellerid2); my $expected_result = { Aqbasketgroup => [$bg1->{id}, $bg2->{id}], Aqbasket => [$basket1->{basketno}, $basket2->{basketno}], @@ -78,7 +78,7 @@ is(GetBasket($basket2->{basketno})->{'booksellerid'}, $booksellerid2, 'Basket 2 is(GetContract({contractnumber => $contract->{contractnumber}})->{'booksellerid'}, $booksellerid2, 'Basket 1 has bookseller 2'); -is(C4::Bookseller::Contact->fetch($contact->{id})->{'booksellerid'}, $booksellerid2, 'Contact 1 has booksellerid 2'); +is(Koha::Acquisition::Bookseller::Contacts->find( $contact->{id} )->booksellerid, $booksellerid2, 'Contact 1 has booksellerid 2'); is(GetInvoice($invoice->{invoiceid})->{'booksellerid'}, $booksellerid2, 'Invoice has bookseller 2'); --