Bugzilla – Attachment 103864 Details for
Bug 25303
Koha::Objects->delete should not skip overridden object class ->delete
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25303: Unit tests
Bug-25303-Unit-tests.patch (text/plain), 1.63 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-04-28 14:46:32 UTC
(
hide
)
Description:
Bug 25303: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-04-28 14:46:32 UTC
Size:
1.63 KB
patch
obsolete
>From 4b394f1ba60e6e77c39b1c16cd95e7627a9af17b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 28 Apr 2020 11:31:28 -0300 >Subject: [PATCH] Bug 25303: Unit tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Objects.t | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t >index c5ac1ba2b6..c81b83358c 100644 >--- a/t/db_dependent/Koha/Objects.t >+++ b/t/db_dependent/Koha/Objects.t >@@ -19,8 +19,9 @@ > > use Modern::Perl; > >-use Test::More tests => 21; >+use Test::More tests => 22; > use Test::Exception; >+use Test::MockModule; > use Test::Warn; > > use Koha::Authority::Types; >@@ -799,3 +800,33 @@ subtest 'prefetch_whitelist() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'delete() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ # Make sure no cities >+ warnings_are { Koha::Cities->delete }[], >+ "No warnings, no Koha::City->delete called as it doesn't exist"; >+ >+ # Mock Koha::City >+ my $mocked_city = Test::MockModule->new('Koha::City'); >+ $mocked_city->mock( >+ 'delete', >+ sub { >+ warn "delete called!"; >+ } >+ ); >+ >+ # Add two cities >+ $builder->build_object( { class => 'Koha::Cities' } ); >+ $builder->build_object( { class => 'Koha::Cities' } ); >+ >+ warnings_are { Koha::Cities->delete } >+ [ "delete called!", "delete called!" ], >+ "No warnings, no Koha::City->delete called as it doesn't exist"; >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.26.2
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 25303
:
103855
|
103859
| 103864 |
103865
|
103941
|
103998
|
104018
|
104027