Bug 25296: Tests for uninstantiated behaviour
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 29 Apr 2020 12:27:22 +0000 (09:27 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 29 Apr 2020 18:00:23 +0000 (19:00 +0100)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

t/db_dependent/Koha/Objects.t

index 2af778a..632d770 100644 (file)
@@ -802,7 +802,7 @@ subtest 'prefetch_whitelist() tests' => sub {
 
 subtest 'empty() tests' => sub {
 
-    plan tests => 3;
+    plan tests => 5;
 
     $schema->storage->txn_begin;
 
@@ -814,5 +814,9 @@ subtest 'empty() tests' => sub {
     is( ref($empty), 'Koha::Patrons', '->empty returns a Koha::Patrons iterator' );
     is( $empty->count, 0, 'The empty resultset is, well, empty :-D' );
 
+    $empty = Koha::Patrons->empty;
+    is( ref($empty), 'Koha::Patrons', 'without being instantiated, ->empty still returns a Koha::Patrons iterator' );
+    is( $empty->count, 0, 'The empty resultset is, well, empty :-D' );
+
     $schema->storage->txn_rollback;
 };