Lines 47-58
my $item1 = create('Item', $booksellerid1);
Link Here
|
47 |
|
47 |
|
48 |
my $subscription = create('Subscription', $booksellerid1); |
48 |
my $subscription = create('Subscription', $booksellerid1); |
49 |
|
49 |
|
50 |
my $bookseller = Koha::Acquisition::Bookseller->fetch({id => $booksellerid1}); |
50 |
my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid1 ); |
51 |
|
51 |
|
52 |
my ($error, $result) = $bookseller->merge_to(345876876); |
52 |
my $result = eval{ $bookseller->merge_with(345876876); }; |
53 |
is($error, "Unknown target bookseller number: 345876876", 'Merge to unknown bookseller return an error' ); |
53 |
like($@, qr/Unknown target bookseller number: 345876876/, 'Merge with unknown bookseller should die.'); |
54 |
|
54 |
|
55 |
($error, $result) = $bookseller->merge_to($booksellerid2); |
55 |
$result = $bookseller->merge_with($booksellerid2); |
56 |
my $expected_result = { |
56 |
my $expected_result = { |
57 |
Aqbasketgroup => [$bg1->{id}, $bg2->{id}], |
57 |
Aqbasketgroup => [$bg1->{id}, $bg2->{id}], |
58 |
Aqbasket => [$basket1->{basketno}, $basket2->{basketno}], |
58 |
Aqbasket => [$basket1->{basketno}, $basket2->{basketno}], |
Lines 78-84
is(GetBasket($basket2->{basketno})->{'booksellerid'}, $booksellerid2, 'Basket 2
Link Here
|
78 |
|
78 |
|
79 |
is(GetContract({contractnumber => $contract->{contractnumber}})->{'booksellerid'}, $booksellerid2, 'Basket 1 has bookseller 2'); |
79 |
is(GetContract({contractnumber => $contract->{contractnumber}})->{'booksellerid'}, $booksellerid2, 'Basket 1 has bookseller 2'); |
80 |
|
80 |
|
81 |
is(C4::Bookseller::Contact->fetch($contact->{id})->{'booksellerid'}, $booksellerid2, 'Contact 1 has booksellerid 2'); |
81 |
is(Koha::Acquisition::Bookseller::Contacts->find( $contact->{id} )->booksellerid, $booksellerid2, 'Contact 1 has booksellerid 2'); |
82 |
|
82 |
|
83 |
is(GetInvoice($invoice->{invoiceid})->{'booksellerid'}, $booksellerid2, 'Invoice has bookseller 2'); |
83 |
is(GetInvoice($invoice->{invoiceid})->{'booksellerid'}, $booksellerid2, 'Invoice has bookseller 2'); |
84 |
|
84 |
|
85 |
- |
|
|