This repository was archived by the owner on Jan 31, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +58
-0
lines changed
Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 99
1010namespace Zend \Router ;
1111
12+ use Zend \Router \Container \RouteConfigFactoryFactory ;
1213use Zend \Router \Container \RoutePluginManagerFactory ;
1314
1415/**
@@ -46,6 +47,7 @@ public function getDependencyConfig()
4647 'RoutePluginManager ' => RoutePluginManager::class,
4748 ],
4849 'factories ' => [
50+ RouteConfigFactory::class => RouteConfigFactoryFactory::class,
4951 RoutePluginManager::class => RoutePluginManagerFactory::class,
5052 ],
5153 ];
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @see https://github.com/zendframework/zend-router for the canonical source repository
4+ * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (http://www.zend.com)
5+ * @license https://github.com/zendframework/zend-router/blob/master/LICENSE.md New BSD License
6+ */
7+
8+ declare (strict_types=1 );
9+
10+ namespace Zend \Router \Container ;
11+
12+ use Psr \Container \ContainerInterface ;
13+ use Zend \Router \RouteConfigFactory ;
14+ use Zend \Router \RoutePluginManager ;
15+
16+ class RouteConfigFactoryFactory
17+ {
18+ public function __invoke (ContainerInterface $ container ) : RouteConfigFactory
19+ {
20+ return new RouteConfigFactory ($ container ->get (RoutePluginManager::class));
21+ }
22+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @see https://github.com/zendframework/zend-router for the canonical source repository
4+ * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (http://www.zend.com)
5+ * @license https://github.com/zendframework/zend-router/blob/master/LICENSE.md New BSD License
6+ */
7+
8+ declare (strict_types=1 );
9+
10+ namespace ZendTest \Router \Container ;
11+
12+ use PHPUnit \Framework \TestCase ;
13+ use Psr \Container \ContainerInterface ;
14+ use Zend \Router \Container \RouteConfigFactoryFactory ;
15+ use Zend \Router \RouteConfigFactory ;
16+ use Zend \Router \RoutePluginManager ;
17+ use Zend \ServiceManager \ServiceManager ;
18+
19+ /**
20+ * @covers \Zend\Router\Container\RouteConfigFactoryFactory
21+ */
22+ class RouteConfigFactoryFactoryTest extends TestCase
23+ {
24+ public function testCreates ()
25+ {
26+ $ container = $ this ->prophesize (ContainerInterface::class);
27+ $ container ->get (RoutePluginManager::class)
28+ ->willReturn (new RoutePluginManager (new ServiceManager ()))
29+ ->shouldBeCalled ();
30+ $ factory = new RouteConfigFactoryFactory ();
31+ $ service = $ factory ->__invoke ($ container ->reveal ());
32+ $ this ->assertInstanceOf (RouteConfigFactory::class, $ service );
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments