@@ -119,7 +119,7 @@ public function test_execute_external_email_address(): void {
119119 }
120120
121121 public function test_execute_multiple_email_addresses (): void {
122- $ emailstosend = [$ this ->user1 ->email . ' , ' . $ this ->user2 ->email . ' , ' . 'testusernotinmoodle@example.com ' ];
122+ $ emailstosend = [$ this ->user1 ->email , $ this ->user2 ->email , 'testusernotinmoodle@example.com ' ];
123123 $ settings = [
124124 'emailto ' => implode (", " , $ emailstosend ),
125125 'emailsubject ' => 'Subject of the email ' ,
@@ -141,6 +141,7 @@ public function test_execute_multiple_email_addresses(): void {
141141 }
142142
143143 public function test_execute_multiple_email_addresses_with_datafields (): void {
144+ $ emailstosend = [$ this ->user1 ->email , $ this ->user2 ->email , 'testusernotinmoodle@example.com ' ];
144145 $ settings = [
145146 'emailto ' => '{user_emails} ' ,
146147 'emailsubject ' => 'Subject of the email ' ,
@@ -151,8 +152,9 @@ public function test_execute_multiple_email_addresses_with_datafields(): void {
151152
152153 // Ensure that this step can accept a string of emails from a previous step.
153154 // Not currently possible with existing steps.
155+ $ emailstosend = [$ this ->user1 ->email , $ this ->user2 ->email ];
154156 $ prevstepresults = [
155- 'user_emails ' => $ this -> user1 -> email . ', ' . $ this -> user2 -> email ,
157+ 'user_emails ' => implode ( ', ' , $ emailstosend ) ,
156158 ];
157159
158160 // Execute the step.
@@ -161,7 +163,7 @@ public function test_execute_multiple_email_addresses_with_datafields(): void {
161163
162164 // Retrieve the messages.
163165 $ messages = $ this ->sink ->get_messages ();
164- $ this ->assertEquals (2 , count ($ messages ));
166+ $ this ->assertEquals (count ( $ emailstosend ) , count ($ messages ));
165167 }
166168
167169 public function test_execute_with_datafields (): void {
0 commit comments