ConversionTest.php in Swift Mailer 8
File
tests/src/Kernel/Utility/ConversionTest.php
View source
<?php
namespace Drupal\Tests\swiftmailer\Kernel\Utility;
use Drupal\KernelTests\KernelTestBase;
use Drupal\swiftmailer\Utility\Conversion;
class ConversionTest extends KernelTestBase {
public function test_swiftmailer_parse_mailboxes($value, $expected) {
$this
->assertSame($expected, Conversion::swiftmailer_parse_mailboxes($value));
}
public function swiftmailer_parse_mailboxes_dataProvider() {
return [
[
'mail@example.com',
[
'mail@example.com',
],
],
[
'mail1@example.com;mail2@example.com',
[
'mail1@example.com',
'mail2@example.com',
],
],
[
'mail1@example.com;invalid-email',
[
'mail1@example.com',
],
],
];
}
}