Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 167bf67

Browse files
committed
Ensure that ConsoleRouter is returned under console environment
1 parent 9c79443 commit 167bf67

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/Service/RouterFactoryTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
class RouterFactoryTest extends TestCase
2121
{
22+
use FactoryEnvironmentTrait;
23+
2224
public function setUp()
2325
{
2426
$this->defaultServiceConfig = [
@@ -70,4 +72,15 @@ public function testFactoryCanCreateRouterWhenOnlyHttpRouterConfigPresent()
7072
$router = $this->factory->__invoke($services, 'router');
7173
$this->assertInstanceOf('Zend\Mvc\Router\Console\SimpleRouteStack', $router);
7274
}
75+
76+
public function testFactoryWillCreateConsoleRouterBasedOnConsoleUsageUnderServiceManagerV2()
77+
{
78+
$this->setConsoleEnvironment(true);
79+
80+
$services = new ServiceManager();
81+
(new Config($this->defaultServiceConfig))->configureServiceManager($services);
82+
83+
$router = $this->factory->createService($services, 'router');
84+
$this->assertInstanceOf('Zend\Mvc\Router\Console\SimpleRouteStack', $router);
85+
}
7386
}

0 commit comments

Comments
 (0)