public function __construct() { if (!class_exists("NyanCat\\Scoreboard")) { throw new \InvalidArgumentException("The NyanCat formatter requires the whatthejeff/nyancat-scoreboard library"); } $this->scoreboard = new Scoreboard(new Cat(), new Rainbow(Fab::getFab(empty($_SERVER['TERM']) ? 'unknown' : $_SERVER['TERM']), array('-', '_'), 74), array(new Team('pass', 'green', '.'), new Team('fail', 'red', 'x'), new Team('pend', 'blue', '-'), new Team('skip', 'yellow', '-')), 6, array($this, 'write')); }
/** * Actions to perform before the test suite * * @param SuiteEvent $event */ public function beforeSuite(SuiteEvent $event) { $io = $this->getIO(); if (!$io->isDecorated()) { return parent::beforeSuite($event); } $this->examplesCount = count($event->getSuite()); $length = strlen((string) $this->examplesCount) + 1; $this->scoreboard = new Scoreboard(new Cat($this->states), new Rainbow(FabFactory::getFab(empty($_SERVER['TERM']) ? 'unknown' : $_SERVER['TERM']), array('-', '_'), 39 - $length), array(new Team('pass', 'green', '^'), new Team('pending', 'yellow', '-'), new Team('fail', 'red', 'o'), new Team('broken', 'magenta', 'o')), 5, array($this->getIO(), 'write')); }
<?php require_once __DIR__ . '/../vendor/autoload.php'; use NyanCat\Cat; use NyanCat\Rainbow; use NyanCat\Team; use NyanCat\Scoreboard; use Fab\Factory as FabFactory; $scoreboard = new Scoreboard(new Cat(array(array(' ___ ', ' / %_) ', ' _.----./ / ', ' / / ', ' __/ ( | ( | ', "/__.-'|_|--|_| "), array(' ___ ', ' / %_)', ' _.----._/ / ', ' / / ', ' __/ ( | ( | ', "/__.-|_|--|_| "), array(' ___ ', ' / %_) ', ' _.----._/ / ', ' / / ', ' _/ ( / / / ', "/_/-|_/--|_/ "))), new Rainbow(FabFactory::getFab(empty($_SERVER['TERM']) ? 'unknown' : $_SERVER['TERM'])), array(new Team('pass', 'green', '^'), new Team('fail', 'red', 'o'), new Team('pending', 'cyan', '-'))); $scoreboard->start(); for ($i = 0; $i < 100; $i++) { usleep(90000); $scoreboard->score('pass'); } $scoreboard->stop();
/** * @dataProvider terminalProvider */ public function testFactory($term, $expected) { $actual = Factory::getFab($term); $this->assertInstanceOf($expected, $actual); }
/** * {@inheritdoc} */ public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE) { $term = empty($_SERVER['TERM']) ? 'unknown' : $_SERVER['TERM']; $this->fab = \Fab\Factory::getFab($term); parent::__construct($out, $verbose, true, $debug); }
<?php require_once 'vendor/autoload.php'; use NyanCat\Cat; use NyanCat\Rainbow; use NyanCat\Team; use NyanCat\Scoreboard; use Fab\Factory as FabFactory; $scoreboard = new Scoreboard(new Cat(), new Rainbow(FabFactory::getFab(empty($_SERVER['TERM']) ? 'unknown' : $_SERVER['TERM'])), array(new Team('pass', 'green', '^'), new Team('fail', 'red', 'o'), new Team('pending', 'cyan', '-'))); $scoreboard->start(); for ($i = 0; $i < 100; $i++) { usleep(90000); $scoreboard->score('pass'); } $scoreboard->stop();
/** * {@inheritdoc} */ public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE) { $this->scoreboard = new Scoreboard(new Cat(), new Rainbow(FabFactory::getFab(empty($_SERVER['TERM']) ? 'unknown' : $_SERVER['TERM'])), array(new Team('pass', 'green', '^'), new Team('fail', 'red', 'o'), new Team('pending', 'cyan', '-')), 5, array($this, 'write')); parent::__construct($out, $verbose, true, $debug); }