Skip to content

Commit 15b8b65

Browse files
committed
Test construct with null label
1 parent 26cd0bf commit 15b8b65

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/framework/tests/Unit/NavigationItemTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)