diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-11-04 18:24:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-04 18:24:55 +0100 |
commit | 5c4a66f0c19f5260c0104de31d526c211b801828 (patch) | |
tree | 3ddb8975f5b69f2de9dd3c0629528a4bf432413c /tests | |
parent | aa3be1111f94ef7979c1a3f1f6a539daf6f3bec4 (diff) | |
parent | fd036f774f92c3f3f8abacd11e8b6d9fc3e75ee5 (diff) | |
download | nextcloud-server-5c4a66f0c19f5260c0104de31d526c211b801828.tar.gz nextcloud-server-5c4a66f0c19f5260c0104de31d526c211b801828.zip |
Merge pull request #34775 from nextcloud/bugfix/noid/mailer-set-to
Do not throw errors when invalid setTo email is provided
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Mail/MessageTest.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/lib/Mail/MessageTest.php b/tests/lib/Mail/MessageTest.php index f30630824fc..bec70d1c78a 100644 --- a/tests/lib/Mail/MessageTest.php +++ b/tests/lib/Mail/MessageTest.php @@ -102,12 +102,23 @@ class MessageTest extends TestCase { $this->assertSame('lukas@owncloud.com', $this->message->getReplyTo()); } - public function testSetTo() { + /** @dataProvider dataSetTo */ + public function testSetTo(array $to, array $expected) { $this->swiftMessage ->expects($this->once()) ->method('setTo') - ->with(['lukas@owncloud.com']); - $this->message->setTo(['lukas@owncloud.com']); + ->with($expected); + $this->message->setTo($to); + } + + public function dataSetTo(): array { + return [ + [['robot@example.com'], ['robot@example.com']], + [['robot'], ['robot' => 'robot']], + [['robot' => 'robot display name'], ['robot' => 'robot display name']], + [['example@🤖.com'], ['example@xn--yp9h.com']], + [['example@🤖.com' => 'A robot'], ['example@xn--yp9h.com' => 'A robot']], + ]; } /** |