Bug 10900 - Follow up, since more has been added to master
Booksellers.t and Koha_template_plugin_Branches.t both had function calls to ::set_userenv added to them. This patch handles those additions. TEST PLAN --------- 1) Branch a new git branch 2) prove -v t/db_dependent/Bookseller.t -- It should work. 3) prove -v t/db_dependent/Koha_template_plugin_Branches.t -- It should work. 4) Apply only the first patch. 5) Repeat steps 2 and 3. -- They should both FAIL! 6) Apply the second patch as well. 7) Repeat steps 2 and 3. -- The should both work. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
78d6d794fe
commit
bd769213eb
2 changed files with 3 additions and 3 deletions
|
@ -637,7 +637,7 @@ ok( exists( $suppliers{$id_supplier1} ),
|
||||||
;
|
;
|
||||||
|
|
||||||
C4::Context->_new_userenv('DUMMY SESSION');
|
C4::Context->_new_userenv('DUMMY SESSION');
|
||||||
C4::Context::set_userenv(0,0,0,'firstname','surname', 'BRANCH1', 'Library 1', 0, '', '');
|
C4::Context->set_userenv(0,0,0,'firstname','surname', 'BRANCH1', 'Library 1', 0, '', '');
|
||||||
my $userenv = C4::Context->userenv;
|
my $userenv = C4::Context->userenv;
|
||||||
|
|
||||||
my $module = Test::MockModule->new('C4::Auth');
|
my $module = Test::MockModule->new('C4::Auth');
|
||||||
|
@ -669,7 +669,7 @@ is(
|
||||||
);
|
);
|
||||||
|
|
||||||
# don the cape and turn into Superlibrarian!
|
# don the cape and turn into Superlibrarian!
|
||||||
C4::Context::set_userenv(0,0,0,'firstname','surname', 'BRANCH1', 'Library 1', 1, '', '');
|
C4::Context->set_userenv(0,0,0,'firstname','surname', 'BRANCH1', 'Library 1', 1, '', '');
|
||||||
@subscriptions = SearchSubscriptions({expiration_date => '2013-12-31'});
|
@subscriptions = SearchSubscriptions({expiration_date => '2013-12-31'});
|
||||||
is(
|
is(
|
||||||
scalar(grep { !$_->{cannotdisplay} } @subscriptions ),
|
scalar(grep { !$_->{cannotdisplay} } @subscriptions ),
|
||||||
|
|
|
@ -41,6 +41,6 @@ my $library = $plugin->GetLoggedInBranchcode();
|
||||||
is($library, '', 'no active library if there is no active user session');
|
is($library, '', 'no active library if there is no active user session');
|
||||||
|
|
||||||
C4::Context->_new_userenv('DUMMY_SESSION_ID');
|
C4::Context->_new_userenv('DUMMY_SESSION_ID');
|
||||||
C4::Context::set_userenv(123, 'userid', 'usercnum', 'First name', 'Surname', 'MYLIBRARY', 'My Library', 0);
|
C4::Context->set_userenv(123, 'userid', 'usercnum', 'First name', 'Surname', 'MYLIBRARY', 'My Library', 0);
|
||||||
$library = $plugin->GetLoggedInBranchcode();
|
$library = $plugin->GetLoggedInBranchcode();
|
||||||
is($library, 'MYLIBRARY', 'GetLoggedInBranchcode() returns active library');
|
is($library, 'MYLIBRARY', 'GetLoggedInBranchcode() returns active library');
|
||||||
|
|
Loading…
Reference in a new issue