Bugzilla – Attachment 98203 Details for
Bug 24213
Koha::Object->get_from_storage should return undef if the object has been deleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24213: Add tests
Bug-24213-Add-tests.patch (text/plain), 1.71 KB, created by
Marcel de Rooy
on 2020-01-31 06:46:21 UTC
(
hide
)
Description:
Bug 24213: Add tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-01-31 06:46:21 UTC
Size:
1.71 KB
patch
obsolete
>From 55be220c4f0340cd869617d46003bc41a99c6fb4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 11 Dec 2019 09:39:15 +0100 >Subject: [PATCH] Bug 24213: Add tests >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/Object.t | 25 ++++++++++++++++++++++++- > 1 file changed, 24 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t >index bcee55ca75..466f95c919 100755 >--- a/t/db_dependent/Koha/Object.t >+++ b/t/db_dependent/Koha/Object.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 17; >+use Test::More tests => 18; > use Test::Exception; > use Test::Warn; > use DateTime; >@@ -737,3 +737,26 @@ subtest 'unblessed_all_relateds' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'get_from_storage' => sub { >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ my $biblio = $builder->build_sample_biblio; >+ >+ my $old_title = $biblio->title; >+ my $new_title = 'new_title'; >+ Koha::Biblios->find( $biblio->biblionumber )->title($new_title)->store; >+ >+ is( $biblio->title, $old_title, 'current $biblio should not be modified' ); >+ is( $biblio->get_from_storage->title, >+ $new_title, 'get_from_storage should return an updated object' ); >+ >+ Koha::Biblios->find( $biblio->biblionumber )->delete; >+ is( ref($biblio), 'Koha::Biblio', 'current $biblio should not be deleted' ); >+ is( $biblio->get_from_storage, undef, >+ 'get_from_storage should return undef if the object has been deleted' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24213
:
96179
|
96180
|
98175
|
98176
| 98203 |
98204