From d987c3e5e2a73ce1f705e9070ac689f5a3c13173 Mon Sep 17 00:00:00 2001 From: Pavlico Date: Fri, 17 Sep 2021 11:47:34 +0200 Subject: [PATCH] Tests --- tests/Api/MailingListTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/Api/MailingListTest.php b/tests/Api/MailingListTest.php index b346187..7060daf 100644 --- a/tests/Api/MailingListTest.php +++ b/tests/Api/MailingListTest.php @@ -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);