This commit is contained in:
Pavlico 2021-09-17 11:47:34 +02:00 committed by David Garcia
parent 73565a6372
commit d987c3e5e2

View File

@ -63,6 +63,23 @@ class MailingListTest extends TestCase
$api->create($address = 'foo@example.com', $name = 'Foo', $description = 'Description', $accessLevel = 'readonly');
}
public function testCreateWithNulls()
{
$data = [
'address' => 'foo@example.com',
'access_level' => 'readonly',
'reply_preference' => 'list',
];
$api = $this->getApiMock();
$api->expects($this->once())
->method('httpPost')
->with('/v3/lists', $data)
->willReturn(new Response());
$api->create($address = 'foo@example.com', null, null, $accessLevel = 'readonly');
}
public function testCreateInvalidAddress()
{
$this->expectException(InvalidArgumentException::class);