@@ -123,48 +123,48 @@ public function testPortmanteaus2()
123123 $ this ->assertEquals ($ expected , $ portmanteaus );
124124 }
125125
126- private function getSingularToPluralData ()
126+ public function pluraliseProvider ()
127127 {
128128 return [
129- 'cat ' => 'cats ' ,
130- 'mitten ' => 'mittens ' ,
131- 'sausage ' => 'sausages ' ,
132- 'child ' => 'children ' ,
133- 'goose ' => 'geese ' ,
134- 'person ' => 'people ' ,
135- 'woman ' => 'women ' ,
136- 'man ' => 'men ' ,
137- 'audio ' => 'audio ' ,
138- 'education ' => 'education ' ,
139- 'rice ' => 'rice ' ,
140- 'love ' => 'love ' ,
141- 'pokemon ' => 'pokemon ' ,
142- 'sheep ' => 'sheep ' ,
143- 'sex ' => 'sexes ' ,
144- 'mouse ' => 'mice ' ,
145- 'mathematics ' => 'mathematics ' ,
146- 'information ' => 'information ' ,
147- 'tooth ' => 'teeth ' ,
129+ [ 'cat ' , 'cats ' ] ,
130+ [ 'mitten ' , 'mittens ' ] ,
131+ [ 'sausage ' , 'sausages ' ] ,
132+ [ 'child ' , 'children ' ] ,
133+ [ 'goose ' , 'geese ' ] ,
134+ [ 'person ' , 'people ' ] ,
135+ [ 'woman ' , 'women ' ] ,
136+ [ 'man ' , 'men ' ] ,
137+ [ 'audio ' , 'audio ' ] ,
138+ [ 'education ' , 'education ' ] ,
139+ [ 'rice ' , 'rice ' ] ,
140+ [ 'love ' , 'love ' ] ,
141+ [ 'pokemon ' , 'pokemon ' ] ,
142+ [ 'sheep ' , 'sheep ' ] ,
143+ [ 'sex ' , 'sexes ' ] ,
144+ [ 'mouse ' , 'mice ' ] ,
145+ [ 'mathematics ' , 'mathematics ' ] ,
146+ [ 'information ' , 'information ' ] ,
147+ [ 'tooth ' , 'teeth ' ] ,
148148 ];
149149 }
150150
151- public function testPluralise ()
151+ /**
152+ * @dataProvider pluraliseProvider
153+ */
154+ public function testPluralise ($ singular , $ plural )
152155 {
153- $ data = $ this -> getSingularToPluralData ( );
156+ $ word = new Word ( $ singular );
154157
155- foreach ($ data as $ singular => $ plural ) {
156- $ word = new Word ($ singular );
157- $ this ->assertEquals ($ plural , $ word ->plural ());
158- }
158+ $ this ->assertEquals ($ plural , $ word ->plural ());
159159 }
160160
161- public function testSingularise ()
161+ /**
162+ * @dataProvider pluraliseProvider
163+ */
164+ public function testSingularise ($ singular , $ plural )
162165 {
163- $ data = $ this -> getSingularToPluralData ( );
166+ $ word = new Word ( $ plural );
164167
165- foreach ($ data as $ singular => $ plural ) {
166- $ word = new Word ($ plural );
167- $ this ->assertEquals ($ singular , $ word ->singular ());
168- }
168+ $ this ->assertEquals ($ singular , $ word ->singular ());
169169 }
170170}
0 commit comments