|
Lines 20-26
Link Here
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::NoWarnings; |
22 |
use Test::NoWarnings; |
| 23 |
use Test::More tests => 14; |
23 |
use Test::More tests => 15; |
| 24 |
use Test::Exception; |
24 |
use Test::Exception; |
| 25 |
|
25 |
|
| 26 |
use t::lib::TestBuilder; |
26 |
use t::lib::TestBuilder; |
|
Lines 445-447
subtest 'close() tests' => sub {
Link Here
|
| 445 |
|
445 |
|
| 446 |
$schema->storage->txn_rollback; |
446 |
$schema->storage->txn_rollback; |
| 447 |
}; |
447 |
}; |
| 448 |
- |
448 |
|
|
|
449 |
subtest 'vendor() tests' => sub { |
| 450 |
|
| 451 |
plan tests => 2; |
| 452 |
|
| 453 |
$schema->storage->txn_begin; |
| 454 |
|
| 455 |
my $basket = $builder->build_object( { class => 'Koha::Acquisition::Baskets' } ); |
| 456 |
my $vendor = $basket->vendor; |
| 457 |
is( ref($vendor), 'Koha::Acquisition::Bookseller', 'Right object type' ); |
| 458 |
my $other_vendor = $builder->build_object( { class => 'Koha::Acquisition::Booksellers' } ); |
| 459 |
|
| 460 |
# change the vendor |
| 461 |
$basket->set( { booksellerid => $other_vendor->id } )->store()->discard_changes(); |
| 462 |
|
| 463 |
is( $basket->vendor->id, $other_vendor->id, 'Method returns the new vendor' ); |
| 464 |
|
| 465 |
$schema->storage->txn_rollback; |
| 466 |
}; |