Bugzilla – Attachment 49264 Details for
Bug 11904
Proposal for a uniform way to send messages to user interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 11904: Unit tests for Koha::Messages
SIGNED-OFF-Bug-11904-Unit-tests-for-KohaMessages.patch (text/plain), 1.76 KB, created by
Owen Leonard
on 2016-03-17 12:53:45 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 11904: Unit tests for Koha::Messages
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-03-17 12:53:45 UTC
Size:
1.76 KB
patch
obsolete
>From 0ea4fc8fa4aa70aaa6631680d90e5cd625da98b6 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 6 Mar 2014 08:47:59 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 11904: Unit tests for Koha::Messages >Content-Type: text/plain; charset="utf-8" > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > t/db_dependent/Koha/Messages.t | 40 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 40 insertions(+) > create mode 100755 t/db_dependent/Koha/Messages.t > >diff --git a/t/db_dependent/Koha/Messages.t b/t/db_dependent/Koha/Messages.t >new file mode 100755 >index 0000000..ac5ab3e >--- /dev/null >+++ b/t/db_dependent/Koha/Messages.t >@@ -0,0 +1,40 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+use Test::More tests => 4; >+use Test::MockModule; >+use C4::Auth qw(get_session); >+ >+use_ok('Koha::Messages'); >+ >+# Create a new session and save it immediately in database. >+my $session = get_session(''); >+$session->flush; >+ >+# Mock CGI::cookie to return the CGISESSID of just created session. >+my $cgi_module = new Test::MockModule('CGI'); >+$cgi_module->mock('cookie', sub { >+ my ($self, $name) = @_; >+ return $session->id if ($name eq 'CGISESSID'); >+}); >+ >+my $messages = messages_get(); >+is_deeply($messages, {}, "no messages at beginning"); >+ >+messages_set('ok 1'); >+messages_set('warning 1', 'warning'); >+messages_set('error 1', 'error'); >+messages_set('ok 2'); >+messages_set('warning 2', 'warning'); >+messages_set('error 2', 'error'); >+ >+$messages = messages_get(); >+my $expected = { >+ 'ok' => ['ok 1', 'ok 2'], >+ 'warning' => ['warning 1', 'warning 2'], >+ 'error' => ['error 1', 'error 2'], >+}; >+is_deeply($messages, $expected, "messages successfully retrieved"); >+ >+$messages = messages_get(); >+is_deeply($messages, {}, "messages emptied automatically"); >-- >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 11904
:
25910
|
25911
|
25912
|
27940
|
27941
|
27942
|
29545
|
29546
|
29547
|
29552
|
29553
|
29554
|
30579
|
30580
|
30581
|
38522
|
38523
|
38524
|
40960
|
40961
|
40962
|
48415
|
48416
|
48417
|
48418
|
49059
|
49060
|
49061
|
49263
| 49264 |
49265