Compare commits

..

1 Commits

Author SHA1 Message Date
Guy Sartorelli
4030ab4c7a
Merge 422bc0256a into 81cba4ed4c 2024-10-14 23:24:13 +00:00

View File

@ -584,41 +584,16 @@ class UserDefinedFormControllerTest extends FunctionalTest
public static function provideValidEmailsToArray()
{
return [
[[], [null]],
[[], [' , , ']],
[[], ['broken.email, broken@.email, broken2.@email']],
[
'input' => [
null
],
'expected' => [],
['broken@email', 'correctemail@email.com'],
[', broken@email, email@-email.com,correctemail@email.com,']
],
[
'input' => [
' , , '
],
'expected' => [],
],
[
'input' => [
'broken.email, broken@.email, broken2.@email'
],
'expected' => [],
],
[
'input' => [
', broken@email, email@-email.com,correctemail@email.com,'
],
'expected' => [
'correctemail@email.com'
],
],
[
'input' => [
'correctemail1@email.com, correctemail2@email.com, correctemail3@email.com'
],
'expected' => [
'correctemail1@email.com',
'correctemail2@email.com',
'correctemail3@email.com'
],
['correctemail1@email.com', 'correctemail2@email.com', 'correctemail3@email.com'],
['correctemail1@email.com, correctemail2@email.com, correctemail3@email.com']
]
];
}
@ -627,7 +602,7 @@ class UserDefinedFormControllerTest extends FunctionalTest
* Test that provided email is valid
*/
#[DataProvider('provideValidEmailsToArray')]
public function testValidEmailsToArray(array $input, array $expected)
public function testValidEmailsToArray(array $expectedOutput, array $input)
{
$class = new ReflectionClass(UserDefinedFormController::class);
$method = $class->getMethod('validEmailsToArray');
@ -635,6 +610,6 @@ class UserDefinedFormControllerTest extends FunctionalTest
$controller = new UserDefinedFormController();
$this->assertEquals($expected, $method->invokeArgs($controller, $input));
$this->assertEquals($expectedOutput, $method->invokeArgs($controller, $input));
}
}