From 9f7a06fd130079eb5779c87408df077350187c96 Mon Sep 17 00:00:00 2001 From: Alexandr Bashurov Date: Tue, 29 Mar 2022 14:03:28 +0700 Subject: [PATCH] TECH Add a test for extended field values --- tests/MailTest.php | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/MailTest.php b/tests/MailTest.php index 408d877a..21505d99 100644 --- a/tests/MailTest.php +++ b/tests/MailTest.php @@ -47,6 +47,57 @@ public function testCreate() static::$client->mail()->delete('name', $mailname->name, static::$webspace->id); } + public function testCreateMultiForwarding() + { + $mailname = static::$client->request([ + 'mail' => [ + 'create' => [ + 'filter' => [ + 'site-id' => static::$webspace->id, + 'mailname' => [ + 'name' => 'test', + 'mailbox' => [ + 'enabled' => true, + ], + 'forwarding' => [ + 'enabled' => true, + 'address' => [ + 'user1@example.com', + 'user2@example.com', + ], + ], + 'alias' => [ + 'test1', + 'test2', + ], + 'password' => [ + 'value' => PasswordProvider::STRONG_PASSWORD, + ], + ], + ], + ], + ], + ]); + + $mailnameInfo = static::$client->request([ + 'mail' => [ + 'get_info' => [ + 'filter' => [ + 'site-id' => static::$webspace->id, + 'name' => 'test', + ], + 'forwarding' => null, + 'aliases' => null, + ], + ], + ]); + + $this->assertSame(2, count($mailnameInfo->mailname->forwarding->address)); + $this->assertSame(2, count($mailnameInfo->mailname->alias)); + + static::$client->mail()->delete('name', 'test', static::$webspace->id); + } + public function testDelete() { $mailname = static::$client->mail()->create('test', static::$webspace->id);