Permalink
Browse files

Remove useless override factories

  • Loading branch information...
1 parent f07fafa commit 336611f1892f415a74fe6c9347956b20e6cf8c1a @blanchonvincent blanchonvincent committed Feb 20, 2013
@@ -10,6 +10,7 @@
use PHPUnit_Framework_TestCase;
use PHPUnit_Framework_ExpectationFailedException;
+use Zend\Console\Console;
use Zend\EventManager\StaticEventManager;
use Zend\Http\Request as HttpRequest;
use Zend\Mvc\Application;
@@ -133,16 +134,7 @@ public function getApplication()
return $this->application;
}
$appConfig = $this->applicationConfig;
- if (!$this->useConsoleRequest) {
- $consoleServiceConfig = array(
- 'service_manager' => array(
- 'factories' => array(
- 'ServiceListener' => 'Zend\Test\PHPUnit\Mvc\Service\ServiceListenerFactory',
- ),
- ),
- );
- $appConfig = array_replace_recursive($appConfig, $consoleServiceConfig);
- }
+ Console::overrideIsConsole($this->getUseConsoleRequest());
$this->application = Application::init($appConfig);
$events = $this->application->getEventManager();
@@ -1,31 +0,0 @@
-<?php
-/**
- * Zend Framework (http://framework.zend.com/)
- *
- * @link http://github.com/zendframework/zf2 for the canonical source repository
- * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-namespace Zend\Test\PHPUnit\Mvc\Service;
-
-use Zend\Mvc\Router\Http\TreeRouteStack as HttpRouter;
-use Zend\ServiceManager\FactoryInterface;
-use Zend\ServiceManager\ServiceLocatorInterface;
-
-class RouterFactory implements FactoryInterface
-{
- /**
- * Create and return router
- *
- * @param ServiceLocatorInterface $serviceLocator
- * @param string|null $cName
- * @param string|null $rName
- * @return HttpRouter
- */
- public function createService(ServiceLocatorInterface $serviceLocator, $cName = null, $rName = null)
- {
- $config = $serviceLocator->get('Config');
- $routerConfig = isset($config['router']) ? $config['router'] : array();
- return HttpRouter::factory($routerConfig);
- }
-}
@@ -1,37 +0,0 @@
-<?php
-/**
- * Zend Framework (http://framework.zend.com/)
- *
- * @link http://github.com/zendframework/zf2 for the canonical source repository
- * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-namespace Zend\Test\PHPUnit\Mvc\Service;
-
-use Zend\Mvc\Service\ServiceListenerFactory as BaseServiceListenerFactory;
-
-class ServiceListenerFactory extends BaseServiceListenerFactory
-{
- /**
- * Create default service configuration
- */
- public function __construct()
- {
- // merge basee config with specific tests config
- $this->defaultServiceConfig = array_replace_recursive(
- $this->defaultServiceConfig,
- array('factories' => array(
- 'Request' => function($sm) {
- return new \Zend\Http\PhpEnvironment\Request();
- },
- 'Response' => function($sm) {
- return new \Zend\Http\PhpEnvironment\Response();
- },
- 'Router' => 'Zend\Test\PHPUnit\Mvc\Service\RouterFactory',
- 'ViewManager' => function($sm) {
- return new \Zend\Mvc\View\Http\ViewManager();
- },
- ))
- );
- }
-}

0 comments on commit 336611f

Please sign in to comment.