diff --git a/src/Suite/Api/ContactList.php b/src/Suite/Api/ContactList.php index 2d7f8ba..1a7e024 100644 --- a/src/Suite/Api/ContactList.php +++ b/src/Suite/Api/ContactList.php @@ -55,7 +55,7 @@ public function findContactListByName(int $customerId, string $listName) { try { foreach ($this->getContactLists($customerId) as $contactListData) { - if (trim(strtolower($contactListData['name'])) == strtolower($listName)) { + if (trim(strtolower($contactListData['name'])) == trim(strtolower($listName))) { return $contactListData['id']; } } diff --git a/test/unit/Suite/Api/ContactListTest.php b/test/unit/Suite/Api/ContactListTest.php index 3eaff72..be68e7c 100644 --- a/test/unit/Suite/Api/ContactListTest.php +++ b/test/unit/Suite/Api/ContactListTest.php @@ -141,7 +141,7 @@ public function findContactListByName_CasesDoNotMatch_ContactListIdStillReturned $this->apiClient->expects($this->once())->method('get')->with($this->endPoints->contactLists($this->customerId)) ->willReturn($this->apiSuccess($contactLists)); - $contactListId = $this->listService->findContactListByName($this->customerId, trim(strtolower($contactListName))); + $contactListId = $this->listService->findContactListByName($this->customerId, $contactListName); $this->assertEquals($this->contactListId, $contactListId); }