diff --git a/test/ServiceManagerTest.php b/test/ServiceManagerTest.php index 85aea61f..86a7c3b3 100644 --- a/test/ServiceManagerTest.php +++ b/test/ServiceManagerTest.php @@ -586,4 +586,17 @@ public function testWithAllowOverrideOnRegisteringAServiceDuplicatingAnExistingA $this->serviceManager->{$method}('response', $service); $this->{$assertion}($expected, $this->serviceManager->get('response')); } + + /** + * @covers Zend\ServiceManager\ServiceManager::canonicalizeName + */ + public function testCanonicalizeName() + { + $this->serviceManager->setService('foo_bar', new \stdClass()); + $this->assertEquals(true, $this->serviceManager->has('foo_bar')); + $this->assertEquals(true, $this->serviceManager->has('foobar')); + $this->assertEquals(true, $this->serviceManager->has('foo-bar')); + $this->assertEquals(true, $this->serviceManager->has('foo/bar')); + $this->assertEquals(true, $this->serviceManager->has('foo bar')); + } }