This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* @see https://github.com/zendframework/zend-router for the canonical source repository | ||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license https://github.com/zendframework/zend-router/blob/master/LICENSE.md New BSD License | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Zend\Router\Container; | ||
|
||
use Psr\Container\ContainerInterface; | ||
use Zend\Router\RouteConfigFactory; | ||
use Zend\Router\RoutePluginManager; | ||
|
||
class RouteConfigFactoryFactory | ||
{ | ||
public function __invoke(ContainerInterface $container) : RouteConfigFactory | ||
{ | ||
return new RouteConfigFactory($container->get(RoutePluginManager::class)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/** | ||
* @see https://github.com/zendframework/zend-router for the canonical source repository | ||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license https://github.com/zendframework/zend-router/blob/master/LICENSE.md New BSD License | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ZendTest\Router\Container; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Psr\Container\ContainerInterface; | ||
use Zend\Router\Container\RouteConfigFactoryFactory; | ||
use Zend\Router\RouteConfigFactory; | ||
use Zend\Router\RoutePluginManager; | ||
use Zend\ServiceManager\ServiceManager; | ||
|
||
/** | ||
* @covers \Zend\Router\Container\RouteConfigFactoryFactory | ||
*/ | ||
class RouteConfigFactoryFactoryTest extends TestCase | ||
{ | ||
public function testCreates() | ||
{ | ||
$container = $this->prophesize(ContainerInterface::class); | ||
$container->get(RoutePluginManager::class) | ||
->willReturn(new RoutePluginManager(new ServiceManager())) | ||
->shouldBeCalled(); | ||
$factory = new RouteConfigFactoryFactory(); | ||
$service = $factory->__invoke($container->reveal()); | ||
$this->assertInstanceOf(RouteConfigFactory::class, $service); | ||
} | ||
} |