Lines 261-267
subtest '->search() tests' => sub {
Link Here
|
261 |
|
261 |
|
262 |
$schema->storage->txn_begin; |
262 |
$schema->storage->txn_begin; |
263 |
|
263 |
|
264 |
Koha::Patrons->delete; |
264 |
my $count = Koha::Patrons->search->count; |
265 |
|
265 |
|
266 |
# Create 10 patrons |
266 |
# Create 10 patrons |
267 |
foreach (1..10) { |
267 |
foreach (1..10) { |
Lines 271-277
subtest '->search() tests' => sub {
Link Here
|
271 |
my $patrons = Koha::Patrons->search(); |
271 |
my $patrons = Koha::Patrons->search(); |
272 |
is( ref($patrons), 'Koha::Patrons', 'search in scalar context returns the Koha::Object-based type' ); |
272 |
is( ref($patrons), 'Koha::Patrons', 'search in scalar context returns the Koha::Object-based type' ); |
273 |
my @patrons = Koha::Patrons->search(); |
273 |
my @patrons = Koha::Patrons->search(); |
274 |
is( scalar @patrons, 10, 'search in list context returns a list of objects' ); |
274 |
is( scalar @patrons, $count + 10, 'search in list context returns a list of objects' ); |
275 |
my $i = 0; |
275 |
my $i = 0; |
276 |
foreach (1..10) { |
276 |
foreach (1..10) { |
277 |
is( ref($patrons[$i]), 'Koha::Patron', 'Objects in the list have the singular type' ); |
277 |
is( ref($patrons[$i]), 'Koha::Patron', 'Objects in the list have the singular type' ); |
278 |
- |
|
|