Created
February 29, 2012 11:55
-
-
Save dmitrybelyakov/1940335 to your computer and use it in GitHub Desktop.
Bootstrap phpunit
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 | |
ini_set("display_errors", 1); | |
chdir(dirname(__DIR__) . '/../../'); | |
require_once 'vendor/.composer/autoload.php'; | |
$appConfig = include 'config/application.config.php'; | |
$listenerOptions = new Zend\Module\Listener\ListenerOptions($appConfig['module_listener_options']); | |
$defaultListeners = new Zend\Module\Listener\DefaultListenerAggregate($listenerOptions); | |
$defaultListeners->getConfigListener()->addConfigGlobPath('config/autoload/*.config.php'); | |
$moduleManager = new Zend\Module\Manager($appConfig['modules']); | |
$moduleManager->events()->attachAggregate($defaultListeners); | |
$moduleManager->loadModules(); | |
// Create application, bootstrap, and run | |
$bootstrap = new Zend\Mvc\Bootstrap($defaultListeners->getConfigListener()->getMergedConfig()); | |
$application = new Zend\Mvc\Application; |
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 | |
require_once ('PHPUnit/Autoload.php'); | |
class FailingTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testTestThatWeJustFail() | |
{ | |
$this->assertTrue(true); | |
} | |
} |
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
<phpunit bootstrap="./bootstrap.php" colors="true"> | |
<testsuite name="Unit tests"> | |
<directory>.</directory> | |
</testsuite> | |
</phpunit> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment