Created
October 26, 2014 01:43
-
-
Save icqparty/b9eca6a016f4a8df0cb3 to your computer and use it in GitHub Desktop.
tests/phpunit.xml and Bootstrap.php
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
<?php | |
use Zend\Mvc\Service\ServiceManagerConfig; | |
use Zend\ServiceManager\ServiceManager; | |
error_reporting(E_ALL | E_STRICT); | |
chdir(dirname(__DIR__)); | |
include __DIR__ . '/../init_autoloader.php'; | |
class Bootstrap | |
{ | |
protected static $serviceManager; | |
public static $config; | |
public static function init() | |
{ | |
$testConfig = include 'config/application.config.php'; | |
if (isset($testConfig['module_listener_options']['config_cache_enabled'])) { | |
$testConfig['module_listener_options']['config_cache_enabled'] = false; | |
} | |
$serviceManager = new ServiceManager(new ServiceManagerConfig()); | |
$serviceManager->setService('ApplicationConfig', $testConfig); | |
$serviceManager->get('ModuleManager')->loadModules(); | |
static::$serviceManager = $serviceManager; | |
static::$config = $testConfig; | |
} | |
} | |
Bootstrap::init(); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit bootstrap="./Bootstrap.php" colors="true"> | |
<testsuites> | |
<testsuite name="ApplicationTest"> | |
<directory suffix=".php">./ApplicationTest</directory> | |
</testsuite> | |
</testsuites> | |
</phpunit> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment