Bugzilla – Attachment 125784 Details for
Bug 29182
ArticleRequest status changing methods calling SUPER::store
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29182: Regression tests
Bug-29182-Regression-tests.patch (text/plain), 2.67 KB, created by
Marcel de Rooy
on 2021-10-06 12:11:41 UTC
(
hide
)
Description:
Bug 29182: Regression tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-10-06 12:11:41 UTC
Size:
2.67 KB
patch
obsolete
>From c53a022ff2aa712a8f305da4d0a2f4ffee79ae6a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 6 Oct 2021 09:00:48 -0300 >Subject: [PATCH] Bug 29182: Regression tests >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/ArticleRequest.t | 28 ++++++++++++++++++++-------- > 1 file changed, 20 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/Koha/ArticleRequest.t b/t/db_dependent/Koha/ArticleRequest.t >index 2f851f3c1c..4339f2a0b2 100755 >--- a/t/db_dependent/Koha/ArticleRequest.t >+++ b/t/db_dependent/Koha/ArticleRequest.t >@@ -23,49 +23,61 @@ use Test::MockModule; > use t::lib::TestBuilder; > use t::lib::Mocks; > >+use Koha::ArticleRequests; >+ > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; > > subtest 'request() tests' => sub { > >- plan tests => 2; >+ plan tests => 3; > > $schema->storage->txn_begin; > >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $biblio = $builder->build_sample_biblio; >+ > my $ar_mock = Test::MockModule->new('Koha::ArticleRequest'); > $ar_mock->mock( 'notify', sub { ok( 1, '->notify() called' ); } ); > >- my $ar = $builder->build_object( >- { class => 'Koha::ArticleRequests', >- value => { status => Koha::ArticleRequest::Status::Pending } >+ my $ar = Koha::ArticleRequest->new( >+ { >+ borrowernumber => $patron->id, >+ biblionumber => $biblio->id, > } > ); > > $ar->request()->discard_changes; > > is( $ar->status, Koha::ArticleRequest::Status::Requested ); >+ ok( defined $ar->created_on, 'created_on is set' ); > > $schema->storage->txn_rollback; > }; > > subtest 'set_pending() tests' => sub { > >- plan tests => 2; >+ plan tests => 3; > > $schema->storage->txn_begin; > >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $biblio = $builder->build_sample_biblio; >+ > my $ar_mock = Test::MockModule->new('Koha::ArticleRequest'); > $ar_mock->mock( 'notify', sub { ok( 1, '->notify() called' ); } ); > >- my $ar = $builder->build_object( >- { class => 'Koha::ArticleRequests', >- value => { status => Koha::ArticleRequest::Status::Requested } >+ my $ar = Koha::ArticleRequest->new( >+ { >+ borrowernumber => $patron->id, >+ biblionumber => $biblio->id, > } > ); > > $ar->set_pending()->discard_changes; > > is( $ar->status, Koha::ArticleRequest::Status::Pending ); >+ ok( defined $ar->created_on, 'created_on is set' ); > > $schema->storage->txn_rollback; > }; >-- >2.20.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 29182
:
125779
|
125780
|
125783
|
125784
|
125785
|
125786
|
125869
|
125871
|
125872
|
125873
|
125874