Skip to content

Commit

Permalink
TECH Add a test for extended field values
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr Bashurov committed Mar 29, 2022
1 parent 465c207 commit 9f7a06f
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/MailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9f7a06f

Please sign in to comment.