Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 2; |
22 |
use Test::More tests => 3; |
23 |
|
23 |
|
24 |
use Koha::Database; |
24 |
use Koha::Database; |
25 |
use Koha::AdditionalContents; |
25 |
use Koha::AdditionalContents; |
Lines 161-163
subtest 'opac_info tests' => sub {
Link Here
|
161 |
|
161 |
|
162 |
$schema->storage->txn_rollback; |
162 |
$schema->storage->txn_rollback; |
163 |
}; |
163 |
}; |
164 |
- |
164 |
|
|
|
165 |
subtest 'desks() tests' => sub { |
166 |
|
167 |
plan tests => 5; |
168 |
|
169 |
$schema->storage->txn_begin; |
170 |
|
171 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
172 |
|
173 |
my $rs = $library->desks; |
174 |
is( ref($rs), 'Koha::Desks' ); |
175 |
is( $rs->count, 0, 'No desks' ); |
176 |
|
177 |
my $desk_1 = $builder->build_object( { class => 'Koha::Desks', value => { branchcode => $library->id } } ); |
178 |
my $desk_2 = $builder->build_object( { class => 'Koha::Desks', value => { branchcode => $library->id } } ); |
179 |
|
180 |
$rs = $library->desks; |
181 |
|
182 |
is( $rs->count, 2 ); |
183 |
is( $rs->next->id, $desk_1->id ); |
184 |
is( $rs->next->id, $desk_2->id ); |
185 |
|
186 |
$schema->storage->txn_rollback; |
187 |
}; |