File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
packages/framework/tests/Unit Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,26 @@ public function testCreateWithNullLabel()
219219 }
220220 }
221221
222+ public function testConstructWithNullLabel ()
223+ {
224+ $ this ->assertSame ('foo ' , (new NavigationItem ('foo ' ))->getLabel ());
225+
226+ $ links = [
227+ 'www.example.com ' ,
228+ 'https://example.com ' ,
229+ 'https://example.com/ ' ,
230+ 'https://example.com/foo ' ,
231+ 'https://example.com/foo/ ' ,
232+ 'https://example.com/foo/bar ' ,
233+ 'https://example.com/foo/bar.html ' ,
234+ 'https://example.com/foo/bar.png ' ,
235+ ];
236+
237+ foreach ($ links as $ link ) {
238+ $ this ->assertSame ($ link , (new NavigationItem ($ link ))->getLabel ());
239+ }
240+ }
241+
222242 public function testPassingRouteKeyToStaticConstructorUsesRouteInstance ()
223243 {
224244 $ route = Routes::get ('index ' );
You can’t perform that action at this time.
0 commit comments