99
1010namespace ZendTest \View \Helper \Navigation ;
1111
12- use Zend \View \Helper \Navigation ;
12+ use Zend \Navigation \Navigation ;
13+ use Zend \ServiceManager \ServiceManager ;
14+ use Zend \View \Helper \Navigation as NavigationHelper ;
1315
1416class AbstractHelperTest extends AbstractTest
1517{
@@ -19,12 +21,12 @@ class AbstractHelperTest extends AbstractTest
1921 *
2022 * @var string
2123 */
22- protected $ _helperName = Navigation ::class;
24+ protected $ _helperName = NavigationHelper ::class;
2325
2426 /**
2527 * View helper
2628 *
27- * @var \Zend\View\Helper\Navigation \Breadcrumbs
29+ * @var NavigationHelper \Breadcrumbs
2830 */
2931 protected $ _helper ;
3032 // @codingStandardsIgnoreEnd
@@ -85,4 +87,29 @@ public function testEventManagerIsNullByDefault()
8587 {
8688 $ this ->assertNull ($ this ->_helper ->getEventManager ());
8789 }
90+
91+ public function testFallBackForContainerNames ()
92+ {
93+ // Register navigation service with name equal to the documentation
94+ $ this ->serviceManager ->setAllowOverride (true );
95+ $ this ->serviceManager ->setService (
96+ 'navigation ' ,
97+ $ this ->serviceManager ->get ('Navigation ' )
98+ );
99+ $ this ->serviceManager ->setAllowOverride (false );
100+
101+ $ this ->_helper ->setServiceLocator ($ this ->serviceManager );
102+
103+ $ this ->_helper ->setContainer ('navigation ' );
104+ $ this ->assertInstanceOf (
105+ Navigation::class,
106+ $ this ->_helper ->getContainer ()
107+ );
108+
109+ $ this ->_helper ->setContainer ('default ' );
110+ $ this ->assertInstanceOf (
111+ Navigation::class,
112+ $ this ->_helper ->getContainer ()
113+ );
114+ }
88115}
0 commit comments