Lines 18-23
Link Here
|
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
|
|
21 |
use utf8; |
21 |
|
22 |
|
22 |
use Koha::Database; |
23 |
use Koha::Database; |
23 |
|
24 |
|
Lines 31-37
my $builder = t::lib::TestBuilder->new;
Link Here
|
31 |
use_ok("Koha::Item::Templates"); |
32 |
use_ok("Koha::Item::Templates"); |
32 |
|
33 |
|
33 |
subtest 'get_available' => sub { |
34 |
subtest 'get_available' => sub { |
34 |
plan tests => 2; |
35 |
plan tests => 3; |
35 |
|
36 |
|
36 |
$schema->storage->txn_begin; |
37 |
$schema->storage->txn_begin; |
37 |
|
38 |
|
Lines 78-87
subtest 'get_available' => sub {
Link Here
|
78 |
{ |
79 |
{ |
79 |
patron_id => $patron_2->id, |
80 |
patron_id => $patron_2->id, |
80 |
name => 'My template', |
81 |
name => 'My template', |
81 |
contents => { location => 'test' }, |
82 |
contents => { location => 'test🙂' }, |
82 |
is_shared => 0, |
83 |
is_shared => 0, |
83 |
} |
84 |
} |
84 |
)->store(); |
85 |
)->store; |
|
|
86 |
$unshared_template->discard_changes; # refresh |
87 |
is( $unshared_template->decoded_contents->{location}, 'test🙂', 'Tested encoding/decoding' ); |
85 |
|
88 |
|
86 |
my $templates = Koha::Item::Templates->get_available( $patron_1->id ); |
89 |
my $templates = Koha::Item::Templates->get_available( $patron_1->id ); |
87 |
is( $templates->{owned}->count, 1, "Got back one owned template" ); |
90 |
is( $templates->{owned}->count, 1, "Got back one owned template" ); |
88 |
- |
|
|