File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,14 @@ public function keys(string $label): array
327
327
return array_keys ($ this ->labels , $ label , true );
328
328
}
329
329
330
+ /**
331
+ * Returns the object labels.
332
+ */
333
+ public function labels (): array
334
+ {
335
+ return $ this ->labels ;
336
+ }
337
+
330
338
/**
331
339
* Set IDNA_* options for functions idn_to_ascii.
332
340
*
Original file line number Diff line number Diff line change @@ -255,6 +255,14 @@ public function keys(string $label): array
255
255
return array_keys ($ this ->labels , $ label , true );
256
256
}
257
257
258
+ /**
259
+ * Returns the object labels.
260
+ */
261
+ public function labels (): array
262
+ {
263
+ return $ this ->labels ;
264
+ }
265
+
258
266
/**
259
267
* Set IDNA_* options for functions idn_to_ascii.
260
268
*
Original file line number Diff line number Diff line change @@ -192,6 +192,23 @@ public function testOffsets()
192
192
self ::assertSame ([], $ domain ->keys ('toto ' ));
193
193
}
194
194
195
+ /**
196
+ * @covers ::labels
197
+ */
198
+ public function testLabels ()
199
+ {
200
+ $ domain = new Domain ('master.com.example.com ' );
201
+ self ::assertSame ([
202
+ 'com ' ,
203
+ 'example ' ,
204
+ 'com ' ,
205
+ 'master ' ,
206
+ ], $ domain ->labels ());
207
+
208
+ $ domain = new Domain ();
209
+ self ::assertSame ([], $ domain ->labels ());
210
+ }
211
+
195
212
/**
196
213
* @covers ::setLabels
197
214
* @covers ::setPublicSuffix
Original file line number Diff line number Diff line change @@ -227,6 +227,22 @@ public function testOffsets()
227
227
self ::assertSame ([2 ], $ domain ->keys ('master ' ));
228
228
}
229
229
230
+ /**
231
+ * @covers ::labels
232
+ */
233
+ public function testLabels ()
234
+ {
235
+ $ publicSuffix = new PublicSuffix ('master.example.com ' );
236
+ self ::assertSame ([
237
+ 'com ' ,
238
+ 'example ' ,
239
+ 'master ' ,
240
+ ], $ publicSuffix ->labels ());
241
+
242
+ $ publicSuffix = new PublicSuffix ();
243
+ self ::assertSame ([], $ publicSuffix ->labels ());
244
+ }
245
+
230
246
/**
231
247
* @covers ::createFromDomain
232
248
* @dataProvider createFromDomainProvider
You can’t perform that action at this time.
0 commit comments