@@ -30,16 +30,15 @@ public function testShowCustomerInfo()
30
30
$ subscribers = $ this ->_collectionModel ->getItems ();
31
31
$ this ->assertCount (3 , $ subscribers );
32
32
33
- $ subscriber = array_shift ($ subscribers );
34
- $ this ->assertEquals ('John ' , $ subscriber ->getFirstname (), $ subscriber ->getSubscriberEmail ());
35
- $ this ->assertEquals ('Smith ' , $ subscriber ->getLastname (), $ subscriber ->getSubscriberEmail ());
36
-
37
- $ subscriber = array_shift ($ subscribers );
38
- $ this ->assertEquals ('John ' , $ subscriber ->getFirstname (), $ subscriber ->getSubscriberEmail ());
39
- $ this ->assertEquals ('Smith ' , $ subscriber ->getLastname (), $ subscriber ->getSubscriberEmail ());
40
-
41
- $ subscriber = array_shift ($ subscribers );
42
- $ this ->assertNull ($ subscriber ->getFirstname (), $ subscriber ->getSubscriberEmail ());
43
- $ this ->assertNull ($ subscriber ->getLastname (), $ subscriber ->getSubscriberEmail ());
33
+ while ($ subscribers ) {
34
+ $ subscriber = array_shift ($ subscribers );
35
+ if ($ subscriber ->getCustomerId ()) {
36
+ $ this ->assertEquals ('John ' , $ subscriber ->getFirstname (), $ subscriber ->getSubscriberEmail ());
37
+ $ this ->assertEquals ('Smith ' , $ subscriber ->getLastname (), $ subscriber ->getSubscriberEmail ());
38
+ } else {
39
+ $ this ->assertNull ($ subscriber ->getFirstname (), $ subscriber ->getSubscriberEmail ());
40
+ $ this ->assertNull ($ subscriber ->getLastname (), $ subscriber ->getSubscriberEmail ());
41
+ }
42
+ }
44
43
}
45
44
}
0 commit comments