Bugzilla – Attachment 29553 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
Bernardo Gonzalez Kriegel
on 2014-07-07 14:55:48 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 11904: Unit tests for Koha::Messages
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-07-07 14:55:48 UTC
Size:
1.76 KB
patch
obsolete
>From 8c0a28e8df9bad6121f7548551982c1a591a4878 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 > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Test pass, no errors. >--- > 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"); >-- >1.7.9.5
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