@@ -128,23 +128,35 @@ public function findContactListByName_Perfect_Perfect()
128128
129129 /**
130130 * @test
131+ * @dataProvider contactListNameProvider
131132 */
132- public function findContactListByName_CasesDoNotMatch_ContactListIdStillReturned ()
133+ public function findContactListByName_CasesDoNotMatch_ContactListIdStillReturned ($ contactListName )
133134 {
134- $ contactLists = array (
135+ $ contactLists = [
135136 $ this ->contactListData ('id1 ' , 'contact list 1 ' ),
136137 $ this ->contactListData ('id2 ' , 'contact list 2 ' ),
137- $ this ->contactListData ($ this ->contactListId , strtoupper ( $ this -> listName ) ),
138- ) ;
138+ $ this ->contactListData ($ this ->contactListId , $ contactListName ),
139+ ] ;
139140
140141 $ this ->apiClient ->expects ($ this ->once ())->method ('get ' )->with ($ this ->endPoints ->contactLists ($ this ->customerId ))
141142 ->willReturn ($ this ->apiSuccess ($ contactLists ));
142143
143- $ contactListId = $ this ->listService ->findContactListByName ($ this ->customerId , $ this -> listName );
144+ $ contactListId = $ this ->listService ->findContactListByName ($ this ->customerId , trim ( strtolower ( $ contactListName )) );
144145
145146 $ this ->assertEquals ($ this ->contactListId , $ contactListId );
146147 }
147148
149+ public function contactListNameProvider ()
150+ {
151+ return [
152+ 'upperCase ' => [strtoupper ($ this ->listName )],
153+ 'lowerCase ' => [strtolower ($ this ->listName )],
154+ 'spaceAfter ' => [$ this ->listName . " " ],
155+ 'spaceBefore ' => [" " . $ this ->listName ],
156+ 'spaceInContactListName ' => [" my very best contact list " ]
157+ ];
158+ }
159+
148160 /**
149161 * @test
150162 */
0 commit comments