public function setUp() { $this->dispatcher = new Symfony\Component\EventDispatcher\EventDispatcher(); $settings = \Codeception\Configuration::$defaultSuiteSettings; $settings['class_name'] = 'CodeGuy'; $this->suiteman = new \Codeception\SuiteManager($this->dispatcher, 'suite', $settings); $printer = \Codeception\Util\Stub::makeEmpty('PHPUnit_TextUI_ResultPrinter'); $this->runner = new \Codeception\PHPUnit\Runner(); $this->runner->setPrinter($printer); }
public function runSuite($suite, $test = null) { $settings = Configuration::suiteSettings($suite, $this->config); $suiteManager = new SuiteManager($this->dispatcher, $suite, $settings); $test ? $suiteManager->loadTest($settings['path'] . $test) : $suiteManager->loadTests(); if (!$this->runner->getPrinter()) { $printer = new PHPUnit\ResultPrinter\UI($this->dispatcher, $this->options); $this->runner->setPrinter($printer); } $suiteManager->run($this->runner, $this->result, $this->options); return $this->result; }
public function __construct($options = array()) { $this->result = new \PHPUnit_Framework_TestResult(); $this->config = Configuration::config(); $this->options = $this->mergeOptions($options); $this->dispatcher = new EventDispatcher(); $this->registerSubscribers(); $this->registerPHPUnitListeners(); $printer = new PHPUnit\ResultPrinter\UI($this->dispatcher, $this->options); $this->runner = new PHPUnit\Runner($this->config); $this->runner->setPrinter($printer); }