Skip to content

Commit ce25ff4

Browse files
authoredMar 29, 2022
Merge pull request #114 from abashurov/master
TECH Add a test for extended field values
2 parents 6517a82 + 9f7a06f commit ce25ff4

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
 

‎tests/MailTest.php

+51
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,57 @@ public function testCreate()
4747
static::$client->mail()->delete('name', $mailname->name, static::$webspace->id);
4848
}
4949

50+
public function testCreateMultiForwarding()
51+
{
52+
$mailname = static::$client->request([
53+
'mail' => [
54+
'create' => [
55+
'filter' => [
56+
'site-id' => static::$webspace->id,
57+
'mailname' => [
58+
'name' => 'test',
59+
'mailbox' => [
60+
'enabled' => true,
61+
],
62+
'forwarding' => [
63+
'enabled' => true,
64+
'address' => [
65+
'user1@example.com',
66+
'user2@example.com',
67+
],
68+
],
69+
'alias' => [
70+
'test1',
71+
'test2',
72+
],
73+
'password' => [
74+
'value' => PasswordProvider::STRONG_PASSWORD,
75+
],
76+
],
77+
],
78+
],
79+
],
80+
]);
81+
82+
$mailnameInfo = static::$client->request([
83+
'mail' => [
84+
'get_info' => [
85+
'filter' => [
86+
'site-id' => static::$webspace->id,
87+
'name' => 'test',
88+
],
89+
'forwarding' => null,
90+
'aliases' => null,
91+
],
92+
],
93+
]);
94+
95+
$this->assertSame(2, count($mailnameInfo->mailname->forwarding->address));
96+
$this->assertSame(2, count($mailnameInfo->mailname->alias));
97+
98+
static::$client->mail()->delete('name', 'test', static::$webspace->id);
99+
}
100+
50101
public function testDelete()
51102
{
52103
$mailname = static::$client->mail()->create('test', static::$webspace->id);

0 commit comments

Comments
 (0)
Please sign in to comment.