This repository was archived by the owner on Jan 31, 2020. It is now read-only.
File tree 3 files changed +58
-0
lines changed
3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 9
9
10
10
namespace Zend \Router ;
11
11
12
+ use Zend \Router \Container \RouteConfigFactoryFactory ;
12
13
use Zend \Router \Container \RoutePluginManagerFactory ;
13
14
14
15
/**
@@ -46,6 +47,7 @@ public function getDependencyConfig()
46
47
'RoutePluginManager ' => RoutePluginManager::class,
47
48
],
48
49
'factories ' => [
50
+ RouteConfigFactory::class => RouteConfigFactoryFactory::class,
49
51
RoutePluginManager::class => RoutePluginManagerFactory::class,
50
52
],
51
53
];
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