public function run(PHPUnit_Framework_TestResult $result = null) { if ($result === null) { $result = $this->createResult(); } ConciseReporter::$test = $this; ConciseReporter::$testCase = new IndependentTestCase(); ConciseReporter::$result = $result; // Create a new Console and parse arguments $console = new Console(array('--reporter', 'concise'), 'php://stdout'); $console->parseArguments(); // Start the runner Runner::$console = $console; Runner::getInstance()->run(); return $result; }
<?php use pho\Runnable\Spec; use pho\Suite\Suite; use pho\Reporter\SpecReporter; use pho\Reporter\ReporterInterface; use pho\Console\Console; describe('SpecReporter', function () { $console = null; $spec = null; before(function () use(&$console, &$spec) { $console = new Console(array(), 'php://output'); $console->parseArguments(); $suite = new Suite('test', function () { }); $spec = new Spec('testspec', function () { }, $suite); }); it('implements the ReporterInterface', function () use(&$console) { $reporter = new SpecReporter($console); expect($reporter instanceof ReporterInterface)->toBeTrue(); }); context('beforeSuite', function () use(&$console) { $reporter = null; before(function () use(&$console, &$reporter) { $reporter = new SpecReporter($console); }); it('prints the suite title', function () use(&$reporter) { $beforeSuite = function () use(&$reporter) { $suite = new Suite('test suite', function () { });