Bug 21912: (QA follow-up) Do not delete existing patrons
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 26 Dec 2018 17:55:53 +0000 (14:55 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 30 Jan 2019 08:02:07 +0000 (09:02 +0100)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8e6c789255a60958ed12eb399b1acd21819fd40c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9b6b80488a6b9315b201a3f6d11d0341e58122b5)

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
(cherry picked from commit 91fbe63d18c7370a1105c21de890fc81c7583f3f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

t/db_dependent/Koha/Objects.t

index d9533f5..74ec560 100644 (file)
@@ -260,7 +260,7 @@ subtest '->search() tests' => sub {
 
     $schema->storage->txn_begin;
 
-    Koha::Patrons->delete;
+    my $count = Koha::Patrons->search->count;
 
     # Create 10 patrons
     foreach (1..10) {
@@ -270,7 +270,7 @@ subtest '->search() tests' => sub {
     my $patrons = Koha::Patrons->search();
     is( ref($patrons), 'Koha::Patrons', 'search in scalar context returns the Koha::Object-based type' );
     my @patrons = Koha::Patrons->search();
-    is( scalar @patrons, 10, 'search in list context returns a list of objects' );
+    is( scalar @patrons, $count + 10, 'search in list context returns a list of objects' );
     my $i = 0;
     foreach (1..10) {
         is( ref($patrons[$i]), 'Koha::Patron', 'Objects in the list have the singular type' );