Bugzilla – Attachment 138126 Details for
Bug 31223
Batch edit items explodes if plugins disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31223: Regression tests
Bug-31223-Regression-tests.patch (text/plain), 1.95 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-07-26 13:00:47 UTC
(
hide
)
Description:
Bug 31223: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-07-26 13:00:47 UTC
Size:
1.95 KB
patch
obsolete
>From 4f064f13d7cee7ec163581f8e880a902c643d376 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 26 Jul 2022 09:54:35 -0300 >Subject: [PATCH] Bug 31223: Regression tests > >This patch adds tests so we are sure things don't explode with/without >plugins enabled. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/BackgroundJob.t | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/BackgroundJob.t b/t/db_dependent/Koha/BackgroundJob.t >index 2c368383f56..8ebcec9e8d5 100755 >--- a/t/db_dependent/Koha/BackgroundJob.t >+++ b/t/db_dependent/Koha/BackgroundJob.t >@@ -38,7 +38,9 @@ my $builder = t::lib::TestBuilder->new; > > subtest '_derived_class() tests' => sub { > >- plan tests => 3; >+ plan tests => 6; >+ >+ t::lib::Mocks::mock_config( 'enable_plugins', 0 ); > > $schema->storage->txn_begin; > >@@ -64,6 +66,30 @@ subtest '_derived_class() tests' => sub { > > is_deeply( $job->unblessed, $derived->unblessed, '_derived_class object refers to the same DB object and can be manipulated as expected' ); > >+ t::lib::Mocks::mock_config( 'enable_plugins', 1 ); >+ >+ $job_object = Koha::BackgroundJob->new(); >+ $mapping = $job_object->type_to_class_mapping; >+ >+ # pick the first >+ $type = ( keys %{$mapping} )[0]; >+ >+ $job = $builder->build_object( >+ { class => 'Koha::BackgroundJobs', >+ value => { type => $type, data => 'Foo' } >+ } >+ ); >+ >+ $derived = $job->_derived_class; >+ >+ is( ref($derived), $mapping->{$type}, 'Job object class is correct' ); >+ ok( $derived->in_storage, 'The object is correctly marked as in storage' ); >+ >+ $derived->data('Bar')->store->discard_changes; >+ $job->discard_changes; >+ >+ is_deeply( $job->unblessed, $derived->unblessed, '_derived_class object refers to the same DB object and can be manipulated as expected' ); >+ > $schema->storage->txn_rollback; > }; > >-- >2.34.1
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 31223
:
138126
|
138127
|
138128
|
138129
|
138130
|
138131
|
138142
|
138143
|
138144
|
138390
|
138391