File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
packages/framework/tests/Feature Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -583,6 +583,37 @@ public function testNavigationItemsInTheYamlConfigCanBeResolvedToRoutes()
583583 $ this ->assertSame (250 , $ navigationItems [1 ]->getPriority ());
584584 }
585585
586+ public function testExtraYamlNavigationItemFieldsAreIgnored ()
587+ {
588+ $ this ->file ('hyde.yml ' , <<<'YAML'
589+ hyde:
590+ navigation:
591+ custom:
592+ - destination: 'about'
593+ extra: 'field'
594+ YAML);
595+
596+ $ this ->runBootstrappers ();
597+
598+ $ configItems = config ('hyde.navigation.custom ' );
599+
600+ $ this ->assertSame ([
601+ [
602+ 'destination ' => 'about ' ,
603+ 'label ' => null ,
604+ 'priority ' => null ,
605+ ],
606+ ], $ configItems );
607+
608+ $ navigationItems = NavigationMenuGenerator::handle (MainNavigationMenu::class)->getItems ()->all ();
609+
610+ $ this ->assertCount (2 , $ navigationItems );
611+
612+ $ this ->assertSame ('about ' , $ navigationItems [1 ]->getLink ());
613+ $ this ->assertSame ('about ' , $ navigationItems [1 ]->getLabel ());
614+ $ this ->assertSame (500 , $ navigationItems [1 ]->getPriority ());
615+ }
616+
586617 public function testTypeErrorsInNavigationYamlConfigAreRethrownMoreHelpfully ()
587618 {
588619 file_put_contents ('hyde.yml ' , <<<'YAML'
You can’t perform that action at this time.
0 commit comments