parseArguments() public method

Furthermore, if the arguments included a non-valid flag or option, or if any of the listed paths were invalid, error message is printed.
public parseArguments ( )
Example #1
0
 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;
 }
Example #2
0
<?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 () {
                });