Bugzilla – Attachment 70633 Details for
Bug 18477
AR_PENDING notice does not populate values from article_requests table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18477: Add tests
Bug-18477-Add-tests.patch (text/plain), 2.79 KB, created by
Mark Tompsett
on 2018-01-17 18:17:06 UTC
(
hide
)
Description:
Bug 18477: Add tests
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2018-01-17 18:17:06 UTC
Size:
2.79 KB
patch
obsolete
>From f5f5293faf8d7cfa5da050f4326636f9c8e219e7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 2 Jan 2018 14:36:43 -0300 >Subject: [PATCH] Bug 18477: Add tests > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > t/db_dependent/ArticleRequests.t | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/ArticleRequests.t b/t/db_dependent/ArticleRequests.t >index ae0c2a3..4d56315 100755 >--- a/t/db_dependent/ArticleRequests.t >+++ b/t/db_dependent/ArticleRequests.t >@@ -19,12 +19,13 @@ use Modern::Perl; > > use POSIX qw(strftime); > >-use Test::More tests => 49; >+use Test::More tests => 54; > > use t::lib::TestBuilder; > > use Koha::Database; > use Koha::Biblio; >+use Koha::Notice::Messages; > use Koha::Patron; > use Koha::Library; > >@@ -73,21 +74,41 @@ my $patron = Koha::Patron->new( > )->store(); > ok( $patron->id, 'Koha::Patron created' ); > >+# store >+Koha::Notice::Messages->delete; >+my $article_request_title = 'an article request title'; > my $article_request = Koha::ArticleRequest->new( > { > borrowernumber => $patron->id, > biblionumber => $biblio->id, > itemnumber => $item->id, >+ title => $article_request_title, > } > )->store(); >+ >+my $notify_message = Koha::Notice::Messages->search->next; >+is( $notify_message->letter_code, "AR_".Koha::ArticleRequest::Status::Pending); >+# Default AR_PROCESSING template content "Title: <<article_requests.title>>" >+like( $notify_message->content, qr{Title: $article_request_title}, 'Values from article_requests table must be fetched for the notification' ); >+ > $article_request = Koha::ArticleRequests->find( $article_request->id ); > ok( $article_request->id, 'Koha::ArticleRequest created' ); >- > is( $article_request->status, Koha::ArticleRequest::Status::Pending, 'New article request has status of Open' ); >+is( $article_request->updated_on, undef, 'New article request has not an updated_on date set yet' ); >+ >+# process >+Koha::Notice::Messages->delete; > $article_request->process(); >+$notify_message = Koha::Notice::Messages->search->next; >+is( $notify_message->letter_code, "AR_".Koha::ArticleRequest::Status::Processing); > is( $article_request->status, Koha::ArticleRequest::Status::Processing, '$ar->process() changes status to Processing' ); >+isnt( $article_request->updated_on, undef, 'Updated article request has an updated_on date set' ); >+ >+# complete > $article_request->complete(); > is( $article_request->status, Koha::ArticleRequest::Status::Completed, '$ar->complete() changes status to Completed' ); >+ >+# cancel > $article_request->cancel(); > is( $article_request->status, Koha::ArticleRequest::Status::Canceled, '$ar->complete() changes status to Canceled' ); > $article_request->status(Koha::ArticleRequest::Status::Pending); >-- >2.1.4
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 18477
:
63251
|
63261
|
70228
|
70231
| 70633 |
70634