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

Commit b97120e

Browse files
committed
Test that the default service config contains console aliases
1 parent 5a0aca1 commit b97120e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/Service/ServiceListenerFactoryTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace ZendTest\Mvc\Service;
1111

1212
use PHPUnit_Framework_TestCase as TestCase;
13+
use ReflectionProperty;
1314
use Zend\Mvc\Service\ServiceListenerFactory;
1415

1516
class ServiceListenerFactoryTest extends TestCase
@@ -179,4 +180,15 @@ public function testInvalidTypeMethod()
179180

180181
$this->factory->__invoke($this->sm, 'ServiceListener');
181182
}
183+
184+
public function testDefinesExpectedAliasesForConsole()
185+
{
186+
$r = new ReflectionProperty($this->factory, 'defaultServiceConfig');
187+
$r->setAccessible(true);
188+
$config = $r->getValue($this->factory);
189+
190+
$this->assertArrayHasKey('aliases', $config, 'Missing aliases from default service config');
191+
$this->assertArrayHasKey('console', $config['aliases'], 'Missing "console" alias from default service config');
192+
$this->assertArrayHasKey('Console', $config['aliases'], 'Missing "Console" alias from default service config');
193+
}
182194
}

0 commit comments

Comments
 (0)