Skip to content

Commit

Permalink
Merge pull request #114 from abashurov/master
Browse files Browse the repository at this point in the history
TECH Add a test for extended field values
  • Loading branch information
sibprogrammer authored Mar 29, 2022
2 parents 6517a82 + 9f7a06f commit ce25ff4
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' => [
'[email protected]',
'[email protected]',
],
],
'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 ce25ff4

Please sign in to comment.