Bug 11843: (follow-up) fix unit test in t/db_dependent/Serials.t
authorJulian Maurice <julian.maurice@biblibre.com>
Wed, 7 May 2014 08:40:58 +0000 (10:40 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 9 May 2014 14:28:58 +0000 (14:28 +0000)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

t/db_dependent/Serials.t

index f1f5d9d..ab466e6 100644 (file)
@@ -234,11 +234,13 @@ is( @others, 6, "GetSerials returns all serials not arrived and not missing if c
 $subscription = C4::Serials::GetSubscription($subscriptionid); # Retrieve the updated subscription
 
 my @serialseqs;
-for my $am ( reverse @arrived_missing ) {
-    if ( grep {/^$am->{status}$/} qw( 4 41 42 43 44 5 ) ) {
+for my $am ( @arrived_missing ) {
+    if ( grep {/^$am->{status}$/} qw( 4 41 42 43 44 ) ) {
         push @serialseqs, $am->{serialseq}
+    } elsif ( grep {/^$am->{status}$/} qw( 5 ) ) {
+        push @serialseqs, 'not issued ' . $am->{serialseq};
     }
 }
-is( $subscription->{missinglist}, 'not issued ' . join('; ', @serialseqs), "subscription missinglist is updated after ModSerialStatus" );
+is( $subscription->{missinglist}, join('; ', @serialseqs), "subscription missinglist is updated after ModSerialStatus" );
 
 $dbh->rollback;