|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 17; |
20 |
use Test::More tests => 18; |
| 21 |
use Test::Exception; |
21 |
use Test::Exception; |
| 22 |
use Test::Warn; |
22 |
use Test::Warn; |
| 23 |
use DateTime; |
23 |
use DateTime; |
|
Lines 737-739
subtest 'unblessed_all_relateds' => sub {
Link Here
|
| 737 |
|
737 |
|
| 738 |
$schema->storage->txn_rollback; |
738 |
$schema->storage->txn_rollback; |
| 739 |
}; |
739 |
}; |
| 740 |
- |
740 |
|
|
|
741 |
subtest 'get_from_storage' => sub { |
| 742 |
plan tests => 4; |
| 743 |
|
| 744 |
$schema->storage->txn_begin; |
| 745 |
|
| 746 |
my $biblio = $builder->build_sample_biblio; |
| 747 |
|
| 748 |
my $old_title = $biblio->title; |
| 749 |
my $new_title = 'new_title'; |
| 750 |
Koha::Biblios->find( $biblio->biblionumber )->title($new_title)->store; |
| 751 |
|
| 752 |
is( $biblio->title, $old_title, 'current $biblio should not be modified' ); |
| 753 |
is( $biblio->get_from_storage->title, |
| 754 |
$new_title, 'get_from_storage should return an updated object' ); |
| 755 |
|
| 756 |
Koha::Biblios->find( $biblio->biblionumber )->delete; |
| 757 |
is( ref($biblio), 'Koha::Biblio', 'current $biblio should not be deleted' ); |
| 758 |
is( $biblio->get_from_storage, undef, |
| 759 |
'get_from_storage should return undef if the object has been deleted' ); |
| 760 |
|
| 761 |
$schema->storage->txn_rollback; |
| 762 |
}; |