Esempio n. 1
1
 public function __construct()
 {
     parent::__construct();
     $firstLevelPrompt = new prompt('> ');
     $secondLevelPrompt = new prompt('=> ');
     $thirdLevelPrompt = new prompt('==> ');
     $atoumField = new runner\atoum\cli();
     $atoumField->setPrompt($firstLevelPrompt);
     $this->addField($atoumField);
     $phpPathField = new runner\php\path\cli();
     $phpPathField->setPrompt($firstLevelPrompt);
     $this->addField($phpPathField);
     $phpVersionField = new runner\php\version\cli();
     $phpVersionField->setTitlePrompt($firstLevelPrompt)->setVersionPrompt($secondLevelPrompt);
     $this->addField($phpVersionField);
     $testsDurationField = new runner\tests\duration\cli();
     $testsDurationField->setPrompt($firstLevelPrompt);
     $this->addField($testsDurationField);
     $memoryField = new runner\tests\memory\cli();
     $memoryField->setPrompt($firstLevelPrompt);
     $this->addField($memoryField);
     $coverageField = new runner\tests\coverage\cli();
     $coverageField->setTitlePrompt($firstLevelPrompt)->setClassPrompt($secondLevelPrompt)->setMethodPrompt($thirdLevelPrompt);
     $runnerDurationField = new runner\duration\cli();
     $runnerDurationField->setPrompt($firstLevelPrompt);
     $this->addField($runnerDurationField);
     $resultField = new runner\result\cli();
     $this->addField($resultField);
     $failuresField = new runner\failures\cli();
     $failuresField->setTitlePrompt($firstLevelPrompt)->setMethodPrompt($secondLevelPrompt);
     $this->addfield($failuresField);
     $errorsField = new runner\errors\cli();
     $errorsField->setTitlePrompt($firstLevelPrompt)->setMethodPrompt($secondLevelPrompt)->setErrorPrompt($thirdLevelPrompt);
     $this->addField($errorsField);
     $exceptionsField = new runner\exceptions\cli();
     $exceptionsField->setTitlePrompt($firstLevelPrompt)->setMethodPrompt($secondLevelPrompt)->setExceptionPrompt($thirdLevelPrompt);
     $this->addField($exceptionsField);
     $uncompletedField = new runner\tests\uncompleted\cli();
     $uncompletedField->setTitlePrompt($firstLevelPrompt)->setMethodPrompt($secondLevelPrompt)->setOutputPrompt($thirdLevelPrompt);
     $this->addField($uncompletedField);
     $voidField = new runner\tests\void\cli();
     $voidField->setTitlePrompt($firstLevelPrompt)->setMethodPrompt($secondLevelPrompt);
     $this->addField($voidField);
     $skippedField = new runner\tests\skipped\cli();
     $skippedField->setTitlePrompt($firstLevelPrompt)->setMethodPrompt($secondLevelPrompt);
     $this->addField($skippedField);
     $outputField = new runner\outputs\cli();
     $outputField->setTitlePrompt($firstLevelPrompt)->setMethodPrompt($secondLevelPrompt);
     $this->addField($outputField);
     $testRunField = new test\run\cli();
     $testRunField->setPrompt($firstLevelPrompt);
     $this->addField($testRunField);
     $testDurationField = new test\duration\cli();
     $testDurationField->setPrompt($secondLevelPrompt);
     $this->addField($testDurationField);
     $testMemoryField = new test\memory\cli();
     $testMemoryField->setPrompt($secondLevelPrompt);
     $this->addField($testMemoryField);
 }
Esempio n. 2
0
 public function __construct()
 {
     parent::__construct();
     $firstLevelColorizer = new colorizer('1;36');
     $firstLevelPrompt = new prompt('> ');
     $secondLevelPrompt = new prompt('=> ', $firstLevelColorizer);
     $thirdLevelPrompt = new prompt('==> ', $firstLevelColorizer);
     $this->addField(new runner\event\cli());
     $resultField = new runner\result\cli();
     $resultField->setSuccessColorizer(new colorizer('0;37', '42'))->setFailureColorizer(new colorizer('0;37', '41'));
     $this->addField($resultField);
     $failureColorizer = new colorizer('0;31');
     $failurePrompt = clone $secondLevelPrompt;
     $failurePrompt->setColorizer($failureColorizer);
     $failuresField = new runner\failures\cli();
     $failuresField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($firstLevelColorizer)->setMethodPrompt($secondLevelPrompt);
     $this->addField($failuresField);
     $outputsField = new runner\outputs\cli();
     $outputsField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($firstLevelColorizer)->setMethodPrompt($secondLevelPrompt);
     $this->addField($outputsField);
     $errorColorizer = new colorizer('0;33');
     $errorMethodPrompt = clone $secondLevelPrompt;
     $errorMethodPrompt->setColorizer($errorColorizer);
     $errorPrompt = clone $thirdLevelPrompt;
     $errorPrompt->setColorizer($errorColorizer);
     $errorsField = new runner\errors\cli();
     $errorsField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($errorColorizer)->setMethodPrompt($errorMethodPrompt)->setErrorPrompt($errorPrompt);
     $this->addField($errorsField);
     $exceptionColorizer = new colorizer('0;35');
     $exceptionMethodPrompt = clone $secondLevelPrompt;
     $exceptionMethodPrompt->setColorizer($exceptionColorizer);
     $exceptionPrompt = clone $thirdLevelPrompt;
     $exceptionPrompt->setColorizer($exceptionColorizer);
     $exceptionsField = new runner\exceptions\cli();
     $exceptionsField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($exceptionColorizer)->setMethodPrompt($exceptionMethodPrompt)->setExceptionPrompt($exceptionPrompt);
     $this->addField($exceptionsField);
     $uncompletedTestColorizer = new colorizer('0;37');
     $uncompletedTestMethodPrompt = clone $secondLevelPrompt;
     $uncompletedTestMethodPrompt->setColorizer($uncompletedTestColorizer);
     $uncompletedTestOutputPrompt = clone $thirdLevelPrompt;
     $uncompletedTestOutputPrompt->setColorizer($uncompletedTestColorizer);
     $uncompletedTestField = new runner\tests\uncompleted\cli();
     $uncompletedTestField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($uncompletedTestColorizer)->setMethodPrompt($uncompletedTestMethodPrompt)->setOutputPrompt($uncompletedTestOutputPrompt);
     $this->addField($uncompletedTestField);
     $voidTestColorizer = new colorizer('0;34');
     $voidTestMethodPrompt = clone $secondLevelPrompt;
     $voidTestMethodPrompt->setColorizer($voidTestColorizer);
     $voidTestOutputPrompt = clone $thirdLevelPrompt;
     $voidTestOutputPrompt->setColorizer($voidTestColorizer);
     $voidTestField = new runner\tests\void\cli();
     $voidTestField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($voidTestColorizer)->setMethodPrompt($voidTestMethodPrompt);
     $this->addField($voidTestField);
     $skippedTestColorizer = new colorizer('0;90');
     $skippedTestMethodPrompt = clone $secondLevelPrompt;
     $skippedTestMethodPrompt->setColorizer($skippedTestColorizer);
     $skippedTestField = new runner\tests\skipped\cli();
     $skippedTestField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($skippedTestColorizer)->setMethodPrompt($skippedTestMethodPrompt);
     $this->addField($skippedTestField);
 }
Esempio n. 3
0
 public function __construct()
 {
     parent::__construct();
     $secondLevelPrompt = new prompt('   ');
     $thirdLevelPrompt = new prompt('      ');
     $this->addField(new runner\php\path\cli());
     $phpVersionField = new runner\php\version\cli();
     $phpVersionField->setVersionPrompt($secondLevelPrompt);
     $this->addField($phpVersionField);
     $this->addField(new runner\duration\cli())->addField(new runner\result\cli());
     $failuresField = new runner\failures\cli();
     $failuresField->setMethodPrompt($secondLevelPrompt);
     $this->addField($failuresField);
     $outputsField = new runner\outputs\cli();
     $outputsField->setMethodPrompt($secondLevelPrompt);
     $this->addField($outputsField);
     $errorsField = new runner\errors\cli();
     $errorsField->setMethodPrompt($secondLevelPrompt)->setErrorPrompt($thirdLevelPrompt);
     $this->addField($errorsField);
     $exceptionsField = new runner\exceptions\cli();
     $exceptionsField->setMethodPrompt($secondLevelPrompt)->setExceptionPrompt($thirdLevelPrompt);
     $this->addField($exceptionsField);
     $uncompletedField = new runner\tests\uncompleted\cli();
     $uncompletedField->setMethodPrompt($secondLevelPrompt)->setOutputPrompt($thirdLevelPrompt);
     $this->addField($uncompletedField);
     $this->addField(new runner\tests\duration\cli())->addField(new runner\tests\memory\cli());
     $coverageField = new runner\tests\coverage\cli();
     $coverageField->setClassPrompt($secondLevelPrompt)->setMethodPrompt($thirdLevelPrompt);
     $this->addField($coverageField)->addField(new test\run\cli());
     $durationField = new test\duration\cli();
     $durationField->setPrompt($secondLevelPrompt);
     $this->addField($durationField);
     $memoryField = new test\memory\cli();
     $memoryField->setPrompt($secondLevelPrompt);
     $this->addField($memoryField);
 }
Esempio n. 4
0
 public function test__toString()
 {
     $this->if($runner = new mock\runner())->and($runner->getMockController()->getScore = $score = new mock\score())->and($defaultField = new runner\errors\cli())->and($customField = new runner\errors\cli($titlePrompt = new prompt(uniqid()), $titleColorizer = new colorizer(uniqid(), uniqid()), $methodPrompt = new prompt(uniqid()), $methodColorizer = new colorizer(uniqid(), uniqid()), $errorPrompt = new prompt(uniqid()), $errorColorizer = new colorizer(uniqid(), uniqid()), $locale = new atoum\locale()))->and($score->getMockController()->getErrors = array())->and($defaultField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($defaultField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEmpty()->and($customField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($customField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEmpty()->if($score->getMockController()->getErrors = $allErrors = array(array('case' => null, 'class' => $class = uniqid(), 'method' => $method = uniqid(), 'file' => $file = uniqid(), 'line' => $line = rand(1, PHP_INT_MAX), 'type' => $type = 'e_fake_error', 'message' => $message = uniqid(), 'errorFile' => $errorFile = uniqid(), 'errorLine' => $errorLine = rand(1, PHP_INT_MAX)), array('case' => null, 'class' => $otherClass = uniqid(), 'method' => $otherMethod = uniqid(), 'file' => $otherFile = uniqid(), 'line' => $otherLine = rand(1, PHP_INT_MAX), 'type' => $otherType = 'e_other_fake_error', 'message' => ($firstOtherMessage = uniqid()) . PHP_EOL . ($secondOtherMessage = uniqid()), 'errorFile' => $otherErrorFile = uniqid(), 'errorLine' => $otherErrorLine = rand(1, PHP_INT_MAX))))->and($defaultField = new runner\errors\cli())->and($defaultField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($defaultField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEqualTo(sprintf('There are %d errors:', sizeof($allErrors)) . PHP_EOL . $class . '::' . $method . '():' . PHP_EOL . sprintf('Error %s in %s on line %d, generated by file %s on line %d:', strtoupper($type), $file, $line, $errorFile, $errorLine) . PHP_EOL . $message . PHP_EOL . $otherClass . '::' . $otherMethod . '():' . PHP_EOL . sprintf('Error %s in %s on line %d, generated by file %s on line %d:', strtoupper($otherType), $otherFile, $otherLine, $otherErrorFile, $otherErrorLine) . PHP_EOL . $firstOtherMessage . PHP_EOL . $secondOtherMessage . PHP_EOL)->if($customField = new runner\errors\cli())->and($customField->setTitlePrompt($titlePrompt = new prompt(uniqid())))->and($customField->setTitleColorizer($titleColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setMethodPrompt($methodPrompt = new prompt(uniqid())))->and($customField->setMethodColorizer($methodColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setErrorPrompt($errorPrompt = new prompt(uniqid())))->and($customField->setErrorColorizer($errorColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setLocale($locale = new atoum\locale()))->and($customField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($customField)->isEmpty()->if($customField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($customField)->isEqualTo($titlePrompt . sprintf($locale->_('%s:'), $titleColorizer->colorize(sprintf($locale->__('There is %d error', 'There are %d errors', sizeof($allErrors)), sizeof($allErrors)))) . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($class . '::' . $method . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in %s on line %d, generated by file %s on line %d'), strtoupper($type), $file, $line, $errorFile, $errorLine))) . PHP_EOL . $message . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($otherClass . '::' . $otherMethod . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in %s on line %d, generated by file %s on line %d'), strtoupper($otherType), $otherFile, $otherLine, $otherErrorFile, $otherErrorLine))) . PHP_EOL . $firstOtherMessage . PHP_EOL . $secondOtherMessage . PHP_EOL)->if($score->getMockController()->getErrors = $allErrors = array(array('case' => $case = uniqid(), 'class' => $class = uniqid(), 'method' => $method = uniqid(), 'file' => $file = uniqid(), 'line' => $line = rand(1, PHP_INT_MAX), 'type' => $type = rand(1, PHP_INT_MAX), 'message' => $message = uniqid(), 'errorFile' => $errorFile = uniqid(), 'errorLine' => $errorLine = rand(1, PHP_INT_MAX)), array('case' => $otherCase = uniqid(), 'class' => $otherClass = uniqid(), 'method' => $otherMethod = uniqid(), 'file' => $otherFile = uniqid(), 'line' => $otherLine = rand(1, PHP_INT_MAX), 'type' => $otherType = rand(1, PHP_INT_MAX), 'message' => ($firstOtherMessage = uniqid()) . PHP_EOL . ($secondOtherMessage = uniqid()), 'errorFile' => $otherErrorFile = uniqid(), 'errorLine' => $otherErrorLine = rand(1, PHP_INT_MAX))))->and($defaultField = new runner\errors\cli())->and($defaultField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($defaultField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEqualTo(sprintf('There are %d errors:', sizeof($allErrors)) . PHP_EOL . $class . '::' . $method . '():' . PHP_EOL . sprintf('Error %s in %s on line %d, generated by file %s on line %d in case \'%s\':', strtoupper($type), $file, $line, $errorFile, $errorLine, $case) . PHP_EOL . $message . PHP_EOL . $otherClass . '::' . $otherMethod . '():' . PHP_EOL . sprintf('Error %s in %s on line %d, generated by file %s on line %d in case \'%s\':', strtoupper($otherType), $otherFile, $otherLine, $otherErrorFile, $otherErrorLine, $otherCase) . PHP_EOL . $firstOtherMessage . PHP_EOL . $secondOtherMessage . PHP_EOL)->if($customField = new runner\errors\cli())->and($customField->setTitlePrompt($titlePrompt = new prompt(uniqid())))->and($customField->setTitleColorizer($titleColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setMethodPrompt($methodPrompt = new prompt(uniqid())))->and($customField->setMethodColorizer($methodColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setErrorPrompt($errorPrompt = new prompt(uniqid())))->and($customField->setErrorColorizer($errorColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setLocale($locale = new atoum\locale()))->and($customField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($customField)->isEmpty()->if($customField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($customField)->isEqualTo($titlePrompt . sprintf($locale->_('%s:'), $titleColorizer->colorize(sprintf($locale->__('There is %d error', 'There are %d errors', sizeof($allErrors)), sizeof($allErrors)))) . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($class . '::' . $method . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in %s on line %d, generated by file %s on line %d in case \'%s\''), strtoupper($type), $file, $line, $errorFile, $errorLine, $case))) . PHP_EOL . $message . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($otherClass . '::' . $otherMethod . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in %s on line %d, generated by file %s on line %d in case \'%s\''), strtoupper($otherType), $otherFile, $otherLine, $otherErrorFile, $otherErrorLine, $otherCase))) . PHP_EOL . $firstOtherMessage . PHP_EOL . $secondOtherMessage . PHP_EOL)->if($score->getMockController()->getErrors = $allErrors = array(array('case' => null, 'class' => $class = uniqid(), 'method' => $method = uniqid(), 'file' => null, 'line' => null, 'type' => $type = rand(1, PHP_INT_MAX), 'message' => $message = uniqid(), 'errorFile' => $errorFile = uniqid(), 'errorLine' => $errorLine = rand(1, PHP_INT_MAX))))->and($defaultField = new runner\errors\cli())->and($defaultField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($defaultField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEqualTo(sprintf('There is %d error:', sizeof($allErrors)) . PHP_EOL . $class . '::' . $method . '():' . PHP_EOL . sprintf('Error %s in unknown file on unknown line, generated by file %s on line %d:', strtoupper($type), $errorFile, $errorLine) . PHP_EOL . $message . PHP_EOL)->if($customField = new runner\errors\cli())->and($customField->setTitlePrompt($titlePrompt = new prompt(uniqid())))->and($customField->setTitleColorizer($titleColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setMethodPrompt($methodPrompt = new prompt(uniqid())))->and($customField->setMethodColorizer($methodColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setErrorPrompt($errorPrompt = new prompt(uniqid())))->and($customField->setErrorColorizer($errorColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setLocale($locale = new atoum\locale()))->and($customField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($customField)->isEmpty()->if($customField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($customField)->isEqualTo($titlePrompt . sprintf($locale->_('%s:'), $titleColorizer->colorize(sprintf($locale->__('There is %d error', 'There are %d errors', sizeof($allErrors)), sizeof($allErrors)))) . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($class . '::' . $method . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in unknown file on unknown line, generated by file %s on line %d'), strtoupper($type), $errorFile, $errorLine))) . PHP_EOL . $message . PHP_EOL)->if($score->getMockController()->getErrors = $allErrors = array(array('case' => $case = uniqid(), 'class' => $class = uniqid(), 'method' => $method = uniqid(), 'file' => null, 'line' => null, 'type' => $type = rand(1, PHP_INT_MAX), 'message' => $message = uniqid(), 'errorFile' => $errorFile = uniqid(), 'errorLine' => $errorLine = rand(1, PHP_INT_MAX))))->and($defaultField = new runner\errors\cli())->and($defaultField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($defaultField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEqualTo(sprintf('There is %d error:', sizeof($allErrors)) . PHP_EOL . $class . '::' . $method . '():' . PHP_EOL . sprintf('Error %s in unknown file on unknown line, generated by file %s on line %d in case \'%s\':', strtoupper($type), $errorFile, $errorLine, $case) . PHP_EOL . $message . PHP_EOL)->if($customField = new runner\errors\cli())->and($customField->setTitlePrompt($titlePrompt = new prompt(uniqid())))->and($customField->setTitleColorizer($titleColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setMethodPrompt($methodPrompt = new prompt(uniqid())))->and($customField->setMethodColorizer($methodColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setErrorPrompt($errorPrompt = new prompt(uniqid())))->and($customField->setErrorColorizer($errorColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setLocale($locale = new atoum\locale()))->and($customField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($customField)->isEmpty()->if($customField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($customField)->isEqualTo($titlePrompt . sprintf($locale->_('%s:'), $titleColorizer->colorize(sprintf($locale->__('There is %d error', 'There are %d errors', sizeof($allErrors)), sizeof($allErrors)))) . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($class . '::' . $method . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in unknown file on unknown line, generated by file %s on line %d in case \'%s\''), strtoupper($type), $errorFile, $errorLine, $case))) . PHP_EOL . $message . PHP_EOL)->if($score->getMockController()->getErrors = $allErrors = array(array('case' => null, 'class' => $class = uniqid(), 'method' => $method = uniqid(), 'file' => null, 'line' => $line = rand(1, PHP_INT_MAX), 'type' => $type = 'e_fake_error', 'message' => $message = uniqid(), 'errorFile' => $errorFile = uniqid(), 'errorLine' => $errorLine = rand(1, PHP_INT_MAX))))->and($defaultField = new runner\errors\cli())->and($defaultField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($defaultField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEqualTo(sprintf('There is %d error:', sizeof($allErrors)) . PHP_EOL . $class . '::' . $method . '():' . PHP_EOL . sprintf('Error %s in unknown file on unknown line, generated by file %s on line %d:', strtoupper($type), $errorFile, $errorLine) . PHP_EOL . $message . PHP_EOL)->if($customField = new runner\errors\cli())->and($customField->setTitlePrompt($titlePrompt = new prompt(uniqid())))->and($customField->setTitleColorizer($titleColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setMethodPrompt($methodPrompt = new prompt(uniqid())))->and($customField->setMethodColorizer($methodColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setErrorPrompt($errorPrompt = new prompt(uniqid())))->and($customField->setErrorColorizer($errorColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setLocale($locale = new atoum\locale()))->and($customField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($customField)->isEmpty()->if($customField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($customField)->isEqualTo($titlePrompt . sprintf($locale->_('%s:'), $titleColorizer->colorize(sprintf($locale->__('There is %d error', 'There are %d errors', sizeof($allErrors)), sizeof($allErrors)))) . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($class . '::' . $method . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in unknown file on unknown line, generated by file %s on line %d'), strtoupper($type), $errorFile, $errorLine))) . PHP_EOL . $message . PHP_EOL)->if($score->getMockController()->getErrors = $allErrors = array(array('case' => $case = uniqid(), 'class' => $class = uniqid(), 'method' => $method = uniqid(), 'file' => $file = uniqid(), 'line' => null, 'type' => $type = 'e_fake_error', 'message' => $message = uniqid(), 'errorFile' => null, 'errorLine' => null)))->and($defaultField = new runner\errors\cli())->and($defaultField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($defaultField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEqualTo(sprintf('There is %d error:', sizeof($allErrors)) . PHP_EOL . $class . '::' . $method . '():' . PHP_EOL . sprintf('Error %s in %s on unknown line, generated by unknown file in case \'%s\':', strtoupper($type), $file, $case) . PHP_EOL . $message . PHP_EOL)->if($customField = new runner\errors\cli())->and($customField->setTitlePrompt($titlePrompt = new prompt(uniqid())))->and($customField->setTitleColorizer($titleColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setMethodPrompt($methodPrompt = new prompt(uniqid())))->and($customField->setMethodColorizer($methodColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setErrorPrompt($errorPrompt = new prompt(uniqid())))->and($customField->setErrorColorizer($errorColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setLocale($locale = new atoum\locale()))->and($customField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($customField)->isEmpty()->if($customField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($customField)->isEqualTo($titlePrompt . sprintf($locale->_('%s:'), $titleColorizer->colorize(sprintf($locale->__('There is %d error', 'There are %d errors', sizeof($allErrors)), sizeof($allErrors)))) . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($class . '::' . $method . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in %s on unknown line, generated by unknown file in case \'%s\''), strtoupper($type), $file, $case))) . PHP_EOL . $message . PHP_EOL)->if($score->getMockController()->getErrors = $allErrors = array(array('case' => $case = uniqid(), 'class' => $class = uniqid(), 'method' => $method = uniqid(), 'file' => null, 'line' => $line = rand(1, PHP_INT_MAX), 'type' => $type = 'e_fake_error', 'message' => $message = uniqid(), 'errorFile' => $errorFile = uniqid(), 'errorLine' => $errorLine = rand(1, PHP_INT_MAX))))->and($defaultField = new runner\errors\cli())->and($defaultField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($defaultField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEqualTo(sprintf('There is %d error:', sizeof($allErrors)) . PHP_EOL . $class . '::' . $method . '():' . PHP_EOL . sprintf('Error %s in unknown file on unknown line, generated by file %s on line %d in case \'%s\':', strtoupper($type), $errorFile, $errorLine, $case) . PHP_EOL . $message . PHP_EOL)->if($customField = new runner\errors\cli())->and($customField->setTitlePrompt($titlePrompt = new prompt(uniqid())))->and($customField->setTitleColorizer($titleColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setMethodPrompt($methodPrompt = new prompt(uniqid())))->and($customField->setMethodColorizer($methodColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setErrorPrompt($errorPrompt = new prompt(uniqid())))->and($customField->setErrorColorizer($errorColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setLocale($locale = new atoum\locale()))->and($customField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($customField)->isEmpty()->if($customField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($customField)->isEqualTo($titlePrompt . sprintf($locale->_('%s:'), $titleColorizer->colorize(sprintf($locale->__('There is %d error', 'There are %d errors', sizeof($allErrors)), sizeof($allErrors)))) . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($class . '::' . $method . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in unknown file on unknown line, generated by file %s on line %d in case \'%s\''), strtoupper($type), $errorFile, $errorLine, $case))) . PHP_EOL . $message . PHP_EOL)->if($score->getMockController()->getErrors = $allErrors = array(array('case' => null, 'class' => $class = uniqid(), 'method' => $method = uniqid(), 'file' => $file = uniqid(), 'line' => null, 'type' => $type = 'e_fake_error', 'message' => $message = uniqid(), 'errorFile' => $errorFile = uniqid(), 'errorLine' => $errorLine = rand(1, PHP_INT_MAX))))->and($defaultField = new runner\errors\cli())->and($defaultField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($defaultField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEqualTo(sprintf('There is %d error:', sizeof($allErrors)) . PHP_EOL . $class . '::' . $method . '():' . PHP_EOL . sprintf('Error %s in %s on unknown line, generated by file %s on line %d:', strtoupper($type), $file, $errorFile, $errorLine) . PHP_EOL . $message . PHP_EOL)->if($customField = new runner\errors\cli())->and($customField->setTitlePrompt($titlePrompt = new prompt(uniqid())))->and($customField->setTitleColorizer($titleColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setMethodPrompt($methodPrompt = new prompt(uniqid())))->and($customField->setMethodColorizer($methodColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setErrorPrompt($errorPrompt = new prompt(uniqid())))->and($customField->setErrorColorizer($errorColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setLocale($locale = new atoum\locale()))->and($customField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($customField)->isEmpty()->if($customField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($customField)->isEqualTo($titlePrompt . sprintf($locale->_('%s:'), $titleColorizer->colorize(sprintf($locale->__('There is %d error', 'There are %d errors', sizeof($allErrors)), sizeof($allErrors)))) . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($class . '::' . $method . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in %s on unknown line, generated by file %s on line %d'), strtoupper($type), $file, $errorFile, $errorLine))) . PHP_EOL . $message . PHP_EOL)->if($score->getMockController()->getErrors = $allErrors = array(array('case' => $case = uniqid(), 'class' => $class = uniqid(), 'method' => $method = uniqid(), 'file' => $file = uniqid(), 'line' => null, 'type' => $type = 'e_fake_error', 'message' => $message = uniqid(), 'errorFile' => $errorFile = uniqid(), 'errorLine' => $errorLine = rand(1, PHP_INT_MAX))))->and($defaultField = new runner\errors\cli())->and($defaultField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($defaultField)->isEmpty()->if($defaultField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($defaultField)->isEqualTo(sprintf('There is %d error:', sizeof($allErrors)) . PHP_EOL . $class . '::' . $method . '():' . PHP_EOL . sprintf('Error %s in %s on unknown line, generated by file %s on line %d in case \'%s\':', strtoupper($type), $file, $errorFile, $errorLine, $case) . PHP_EOL . $message . PHP_EOL)->if($customField = new runner\errors\cli())->and($customField->setTitlePrompt($titlePrompt = new prompt(uniqid())))->and($customField->setTitleColorizer($titleColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setMethodPrompt($methodPrompt = new prompt(uniqid())))->and($customField->setMethodColorizer($methodColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setErrorPrompt($errorPrompt = new prompt(uniqid())))->and($customField->setErrorColorizer($errorColorizer = new colorizer(uniqid(), uniqid())))->and($customField->setLocale($locale = new atoum\locale()))->and($customField->handleEvent(atoum\runner::runStart, $runner))->then->castToString($customField)->isEmpty()->if($customField->handleEvent(atoum\runner::runStop, $runner))->then->castToString($customField)->isEqualTo($titlePrompt . sprintf($locale->_('%s:'), $titleColorizer->colorize(sprintf($locale->__('There is %d error', 'There are %d errors', sizeof($allErrors)), sizeof($allErrors)))) . PHP_EOL . $methodPrompt . sprintf($locale->_('%s:'), $methodColorizer->colorize($class . '::' . $method . '()')) . PHP_EOL . $errorPrompt . sprintf($locale->_('%s:'), $errorColorizer->colorize(sprintf($locale->_('Error %s in %s on unknown line, generated by file %s on line %d in case \'%s\''), strtoupper($type), $file, $errorFile, $errorLine, $case))) . PHP_EOL . $message . PHP_EOL);
 }
Esempio n. 5
0
 protected function build()
 {
     $this->resetFields();
     $firstLevelPrompt = new prompt(PHP_EOL);
     $firstLevelColorizer = new colorizer('1;36');
     $secondLevelPrompt = new prompt(' ', $firstLevelColorizer);
     $failureColorizer = new colorizer('0;31');
     $failurePrompt = clone $secondLevelPrompt;
     $failurePrompt->setColorizer($failureColorizer);
     $errorColorizer = new colorizer('0;33');
     $errorPrompt = clone $secondLevelPrompt;
     $errorPrompt->setColorizer($errorColorizer);
     $exceptionColorizer = new colorizer('0;35');
     $exceptionPrompt = clone $secondLevelPrompt;
     $exceptionPrompt->setColorizer($exceptionColorizer);
     $uncompletedTestColorizer = new colorizer('0;37');
     $uncompletedTestMethodPrompt = clone $secondLevelPrompt;
     $uncompletedTestMethodPrompt->setColorizer($uncompletedTestColorizer);
     $uncompletedTestOutputPrompt = new prompt('  ', $uncompletedTestColorizer);
     $voidTestColorizer = new colorizer('0;34');
     $voidTestMethodPrompt = clone $secondLevelPrompt;
     $voidTestMethodPrompt->setColorizer($voidTestColorizer);
     $skippedTestColorizer = new colorizer('0;90');
     $skippedTestMethodPrompt = clone $secondLevelPrompt;
     $skippedTestMethodPrompt->setColorizer($skippedTestColorizer);
     $phpPathField = new runner\php\path\cli();
     $phpPathField->setPrompt($firstLevelPrompt)->setTitleColorizer($firstLevelColorizer);
     $this->addField($phpPathField);
     $phpVersionField = new runner\php\version\cli();
     $phpVersionField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($firstLevelColorizer)->setVersionPrompt($secondLevelPrompt);
     $this->addField($phpVersionField);
     if ($this->showDuration === true) {
         $runnerDurationField = new runner\duration\cli();
         $runnerDurationField->setPrompt($firstLevelPrompt)->setTitleColorizer($firstLevelColorizer);
         $this->addField($runnerDurationField);
     }
     if ($this->showMemory === true) {
         $runnerTestsMemoryField = new runner\tests\memory\phing();
         $runnerTestsMemoryField->setPrompt($firstLevelPrompt)->setTitleColorizer($firstLevelColorizer);
         $this->addField($runnerTestsMemoryField);
     }
     if ($this->showCodeCoverage === true) {
         $runnerTestsCoverageField = new runner\tests\coverage\phing();
         $runnerTestsCoverageField->setTitlePrompt($firstLevelPrompt)->setClassPrompt($secondLevelPrompt)->setMethodPrompt(new prompt('  ', $firstLevelColorizer))->setTitleColorizer($firstLevelColorizer);
         if ($this->showMissingCodeCoverage === false) {
             $runnerTestsCoverageField->hideMissingCodeCoverage();
         }
         $this->addField($runnerTestsCoverageField);
     }
     $resultField = new runner\result\cli();
     $resultField->setPrompt($firstLevelPrompt)->setSuccessColorizer(new colorizer('0;37', '42'))->setFailureColorizer(new colorizer('0;37', '41'));
     $this->addField($resultField);
     $failuresField = new runner\failures\cli();
     $failuresField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($failureColorizer)->setMethodPrompt($failurePrompt);
     $this->addField($failuresField);
     $outputsField = new runner\outputs\cli();
     $outputsField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($firstLevelColorizer)->setMethodPrompt($secondLevelPrompt);
     $this->addField($outputsField);
     $errorsField = new runner\errors\cli();
     $errorsField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($errorColorizer)->setMethodPrompt($errorPrompt);
     $this->addField($errorsField);
     $exceptionsField = new runner\exceptions\cli();
     $exceptionsField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($exceptionColorizer)->setMethodPrompt($exceptionPrompt);
     $this->addField($exceptionsField);
     $runnerUncompletedField = new runner\tests\uncompleted\cli();
     $runnerUncompletedField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($uncompletedTestColorizer)->setMethodPrompt($uncompletedTestMethodPrompt)->setOutputPrompt($uncompletedTestOutputPrompt);
     $this->addField($runnerUncompletedField);
     $runnerVoidField = new runner\tests\void\cli();
     $runnerVoidField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($voidTestColorizer)->setMethodPrompt($voidTestMethodPrompt);
     $this->addField($runnerVoidField);
     $runnerSkippedField = new runner\tests\skipped\cli();
     $runnerSkippedField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($skippedTestColorizer)->setMethodPrompt($skippedTestMethodPrompt);
     $this->addField($runnerSkippedField);
     if ($this->showProgress === true) {
         $runField = new test\run\phing();
         $runField->setPrompt($firstLevelPrompt)->setColorizer($firstLevelColorizer);
         $this->addField($runField)->addField(new test\event\phing());
     }
     if ($this->showDuration === true) {
         $durationField = new test\duration\phing();
         $durationField->setPrompt($secondLevelPrompt);
         $this->addField($durationField);
     }
     if ($this->showMemory === true) {
         $memoryField = new test\memory\phing();
         $memoryField->setPrompt($secondLevelPrompt);
         $this->addField($memoryField);
     }
     if ($this->codeCoverageReportPath !== null) {
         $coverageField = new atoum\report\fields\runner\coverage\html($this->codeCoverageReportProjectName ?: '', $this->codeCoverageReportPath);
         $coverageField->setRootUrl($this->codeCoverageReportUrl ?: 'file:////' . realpath($this->codeCoverageReportPath));
         $this->addField($coverageField);
     }
     return $this;
 }
Esempio n. 6
0
 public function __construct()
 {
     parent::__construct();
     $defaultColorizer = new colorizer('1;31');
     $firstLevelPrompt = new prompt('> ');
     $secondLevelPrompt = new prompt('=> ', $defaultColorizer);
     $thirdLevelPrompt = new prompt('==> ', $defaultColorizer);
     $phpPathField = new runner\php\path\cli();
     $phpPathField->setPrompt($firstLevelPrompt)->setTitleColorizer($defaultColorizer);
     $this->addField($phpPathField);
     $phpVersionField = new runner\php\version\cli();
     $phpVersionField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($defaultColorizer)->setVersionPrompt($secondLevelPrompt);
     $this->addField($phpVersionField);
     $runnerTestsDurationField = new runner\tests\duration\cli();
     $runnerTestsDurationField->setPrompt($firstLevelPrompt)->setTitleColorizer($defaultColorizer);
     $runnerTestsMemoryField = new runner\tests\memory\cli();
     $runnerTestsMemoryField->setPrompt($firstLevelPrompt)->setTitleColorizer($defaultColorizer);
     $this->addField($runnerTestsMemoryField);
     $runnerTestsCoverageField = new runner\tests\coverage\cli();
     $runnerTestsCoverageField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($defaultColorizer)->setClassPrompt($secondLevelPrompt)->setMethodPrompt(new prompt('==> ', $defaultColorizer));
     $this->addField($runnerTestsCoverageField);
     $runnerDurationField = new runner\duration\cli();
     $runnerDurationField->setPrompt($firstLevelPrompt)->setTitleColorizer($defaultColorizer);
     $this->addField($runnerDurationField);
     $runnerResultField = new runner\result\cli();
     $runnerResultField->setSuccessColorizer(new colorizer('0;37', '42'))->setFailureColorizer(new colorizer('0;37', '41'));
     $this->addField($runnerResultField);
     $this->addField($runnerTestsDurationField);
     $this->addField(new runner\event\santa());
     $failureColorizer = new colorizer('0;31');
     $failurePrompt = clone $secondLevelPrompt;
     $failurePrompt->setColorizer($failureColorizer);
     $runnerFailuresField = new runner\failures\cli();
     $runnerFailuresField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($failureColorizer)->setMethodPrompt($failurePrompt);
     $this->addField($runnerFailuresField);
     $runnerOutputsField = new runner\outputs\cli();
     $runnerOutputsField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($defaultColorizer)->setMethodPrompt($secondLevelPrompt);
     $this->addField($runnerOutputsField);
     $errorColorizer = new colorizer('0;33');
     $errorMethodPrompt = clone $secondLevelPrompt;
     $errorMethodPrompt->setColorizer($errorColorizer);
     $errorPrompt = clone $thirdLevelPrompt;
     $errorPrompt->setColorizer($errorColorizer);
     $runnerErrorsField = new runner\errors\cli();
     $runnerErrorsField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($errorColorizer)->setMethodPrompt($errorMethodPrompt)->setErrorPrompt($errorPrompt);
     $this->addField($runnerErrorsField);
     $exceptionColorizer = new colorizer('0;35');
     $exceptionMethodPrompt = clone $secondLevelPrompt;
     $exceptionMethodPrompt->setColorizer($exceptionColorizer);
     $exceptionPrompt = clone $thirdLevelPrompt;
     $exceptionPrompt->setColorizer($exceptionColorizer);
     $runnerExceptionsField = new runner\exceptions\cli();
     $runnerExceptionsField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($exceptionColorizer)->setMethodPrompt($exceptionMethodPrompt)->setExceptionPrompt($exceptionPrompt);
     $this->addField($runnerExceptionsField);
     $uncompletedTestColorizer = new colorizer('0;37');
     $uncompletedTestMethodPrompt = clone $secondLevelPrompt;
     $uncompletedTestMethodPrompt->setColorizer($uncompletedTestColorizer);
     $uncompletedTestOutputPrompt = clone $thirdLevelPrompt;
     $uncompletedTestOutputPrompt->setColorizer($uncompletedTestColorizer);
     $runnerUncompletedField = new runner\tests\uncompleted\cli();
     $runnerUncompletedField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($uncompletedTestColorizer)->setMethodPrompt($uncompletedTestMethodPrompt)->setOutputPrompt($uncompletedTestOutputPrompt);
     $this->addField($runnerUncompletedField);
     $voidTestColorizer = new colorizer('0;34');
     $voidTestMethodPrompt = clone $secondLevelPrompt;
     $voidTestMethodPrompt->setColorizer($voidTestColorizer);
     $runnerVoidField = new runner\tests\void\cli();
     $runnerVoidField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($voidTestColorizer)->setMethodPrompt($voidTestMethodPrompt);
     $this->addField($runnerVoidField);
     $skippedTestColorizer = new colorizer('0;90');
     $skippedTestMethodPrompt = clone $secondLevelPrompt;
     $skippedTestMethodPrompt->setColorizer($skippedTestColorizer);
     $runnerSkippedField = new runner\tests\skipped\cli();
     $runnerSkippedField->setTitlePrompt($firstLevelPrompt)->setTitleColorizer($skippedTestColorizer)->setMethodPrompt($skippedTestMethodPrompt);
     $this->addField($runnerSkippedField);
 }
Esempio n. 7
0
 public function test__construct()
 {
     $this->define($eventField = new fields\runner\event\cli())->define($resultField = new fields\runner\result\cli())->define($resultField->setSuccessColorizer(new colorizer('0;37', '42'))->setFailureColorizer(new colorizer('0;37', '41')))->define($failuresField = new fields\runner\failures\cli())->define($failuresField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('1;36'))->setMethodPrompt(new prompt('=> ', new colorizer('1;36'))))->define($outputsField = new fields\runner\outputs\cli())->define($outputsField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('1;36'))->setMethodPrompt(new prompt('=> ', new colorizer('1;36'))))->define($errorsField = new fields\runner\errors\cli())->define($errorsField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;33'))->setMethodPrompt(new prompt('=> ', new colorizer('0;33')))->setErrorPrompt(new prompt('==> ', new colorizer('0;33'))))->define($exceptionsField = new fields\runner\exceptions\cli())->define($exceptionsField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;35'))->setMethodPrompt(new prompt('=> ', new colorizer('0;35')))->setExceptionPrompt(new prompt('==> ', new colorizer('0;35'))))->define($uncompletedTestField = new fields\runner\tests\uncompleted\cli())->define($uncompletedTestField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;37'))->setMethodPrompt(new prompt('=> ', new colorizer('0;37')))->setOutputPrompt(new prompt('==> ', new colorizer('0;37'))))->define($voidTestField = new fields\runner\tests\void\cli())->define($voidTestField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;34'))->setMethodPrompt(new prompt('=> ', new colorizer('0;34'))))->define($skippedTestField = new fields\runner\tests\skipped\cli())->and($skippedTestField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;90'))->setMethodPrompt(new prompt('=> ', new colorizer('0;90'))))->if($report = new testedClass())->then->object($report->getLocale())->isEqualTo(new atoum\locale())->object($report->getAdapter())->isEqualTo(new atoum\adapter())->array($report->getFields())->isEqualTo(array($eventField, $resultField, $failuresField, $outputsField, $errorsField, $exceptionsField, $uncompletedTestField, $voidTestField, $skippedTestField));
 }
Esempio n. 8
0
 public function test__construct()
 {
     $this->define($phpPathField = new fields\runner\php\path\cli())->and($phpPathField->setPrompt(new prompt('> '))->setTitleColorizer(new colorizer('1;36')))->define($phpVersionField = new fields\runner\php\version\cli())->and($phpVersionField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('1;36'))->setVersionPrompt(new prompt('=> ', new colorizer('1;36'))))->define($runnerTestsDurationField = new fields\runner\tests\duration\cli())->and($runnerTestsDurationField->setPrompt(new prompt('> '))->setTitleColorizer(new colorizer('1;36')))->define($runnerTestsMemoryField = new fields\runner\tests\memory\cli())->and($runnerTestsMemoryField->setPrompt(new prompt('> '))->setTitleColorizer(new colorizer('1;36')))->define($runnerTestsCoverageField = new fields\runner\tests\coverage\cli())->and($runnerTestsCoverageField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('1;36'))->setClassPrompt(new prompt('=> ', new colorizer('1;36')))->setMethodPrompt(new prompt('==> ', new colorizer('1;36'))))->define($runnerDurationField = new fields\runner\duration\cli())->and($runnerDurationField->setPrompt(new prompt('> '))->setTitleColorizer(new colorizer('1;36')))->define($runnerResultField = new fields\runner\result\cli())->and($runnerResultField->setSuccessColorizer(new colorizer('0;37', '42'))->setFailureColorizer(new colorizer('0;37', '41')))->define($runnerFailuresField = new fields\runner\failures\cli())->and($runnerFailuresField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;31'))->setMethodPrompt(new prompt('=> ', new colorizer('0;31'))))->define($runnerOutputsField = new fields\runner\outputs\cli())->and($runnerOutputsField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('1;36'))->setMethodPrompt(new prompt('=> ', new colorizer('1;36'))))->define($runnerErrorsField = new fields\runner\errors\cli())->and($runnerErrorsField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;33'))->setMethodPrompt(new prompt('=> ', new colorizer('0;33')))->setErrorPrompt(new prompt('==> ', new colorizer('0;33'))))->define($runnerExceptionsField = new fields\runner\exceptions\cli())->and($runnerExceptionsField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;35'))->setMethodPrompt(new prompt('=> ', new colorizer('0;35')))->setExceptionPrompt(new prompt('==> ', new colorizer('0;35'))))->define($runnerUncompletedField = new fields\runner\tests\uncompleted\cli())->and($runnerUncompletedField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;37'))->setMethodPrompt(new prompt('=> ', new colorizer('0;37')))->setOutputPrompt(new prompt('==> ', new colorizer('0;37'))))->define($runnerVoidField = new fields\runner\tests\void\cli())->and($runnerVoidField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;34'))->setMethodPrompt(new prompt('=> ', new colorizer('0;34'))))->define($runnerSkippedField = new fields\runner\tests\skipped\cli())->and($runnerSkippedField->setTitlePrompt(new prompt('> '))->setTitleColorizer(new colorizer('0;90'))->setMethodPrompt(new prompt('=> ', new colorizer('0;90'))))->define($testRunField = new fields\test\run\cli())->and($testRunField->setPrompt(new prompt('> '))->setColorizer(new colorizer('1;36')))->define($testDurationField = new fields\test\duration\cli())->and($testDurationField->setPrompt(new prompt('=> ', new colorizer('1;36'))))->define($testMemoryField = new fields\test\memory\cli())->and($testMemoryField->setPrompt(new prompt('=> ', new colorizer('1;36'))))->if($report = new testedClass())->then->object($report->getLocale())->isEqualTo(new atoum\locale())->object($report->getAdapter())->isEqualTo(new atoum\adapter())->array($report->getFields())->isEqualTo(array($phpPathField, $phpVersionField, $runnerTestsDurationField, $runnerTestsMemoryField, $runnerTestsCoverageField, $runnerDurationField, $runnerResultField, $runnerFailuresField, $runnerOutputsField, $runnerErrorsField, $runnerExceptionsField, $runnerUncompletedField, $runnerVoidField, $runnerSkippedField, $testRunField, new fields\test\event\cli(), $testDurationField, $testMemoryField));
 }
Esempio n. 9
0
 public function test__construct()
 {
     $this->define($phpVersionField = new runner\php\version\cli())->and($phpVersionField->setVersionPrompt(new prompt('   ')))->define($failuresField = new runner\failures\cli())->and($failuresField->setMethodPrompt(new prompt('   ')))->define($outputsField = new runner\outputs\cli())->and($outputsField->setMethodPrompt(new prompt('   ')))->define($errorsField = new runner\errors\cli())->and($errorsField->setMethodPrompt(new prompt('   '))->setErrorPrompt(new prompt('      ')))->define($exceptionsField = new runner\exceptions\cli())->and($exceptionsField->setMethodPrompt(new prompt('   '))->setExceptionPrompt(new prompt('      ')))->define($uncompletedField = new runner\tests\uncompleted\cli())->and($uncompletedField->setMethodPrompt(new prompt('   '))->setOutputPrompt(new prompt('      ')))->define($coverageField = new runner\tests\coverage\cli())->and($coverageField->setClassPrompt(new prompt('   '))->setMethodPrompt(new prompt('      ')))->define($durationField = new test\duration\cli())->and($durationField->setPrompt(new prompt('   ')))->define($memoryField = new test\memory\cli())->and($memoryField->setPrompt(new prompt('   ')))->if($report = new testedClass())->then->object($report->getLocale())->isEqualTo(new atoum\locale())->object($report->getAdapter())->isEqualTo(new atoum\adapter())->array($report->getFields())->isEqualTo(array(new runner\php\path\cli(), $phpVersionField, new runner\duration\cli(), new runner\result\cli(), $failuresField, $outputsField, $errorsField, $exceptionsField, $uncompletedField, new runner\tests\duration\cli(), new runner\tests\memory\cli(), $coverageField, new test\run\cli(), $durationField, $memoryField));
 }
Esempio n. 10
0
 public function test__construct()
 {
     $this->define($phpPathField = new fields\runner\php\path\cli())->and($phpPathField->setPrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('1;36')))->define($phpVersionField = new fields\runner\php\version\cli())->and($phpVersionField->setTitlePrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('1;36'))->setVersionPrompt(new prompt(' ', new colorizer('1;36'))))->define($runnerTestsDurationField = new fields\runner\duration\cli())->and($runnerTestsDurationField->setPrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('1;36')))->define($runnerTestsMemoryField = new fields\runner\tests\memory\phing())->and($runnerTestsMemoryField->setPrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('1;36')))->define($runnerTestsCoverageField = new fields\runner\tests\coverage\phing())->and($runnerTestsCoverageField->setTitlePrompt(new prompt(PHP_EOL))->setClassPrompt(new prompt(' ', new colorizer('1;36')))->setMethodPrompt(new prompt('  ', new colorizer('1;36')))->setTitleColorizer(new colorizer('1;36')))->define($runnerResultField = new fields\runner\result\cli())->and($runnerResultField->setPrompt(new prompt(PHP_EOL))->setSuccessColorizer(new colorizer('0;37', '42'))->setFailureColorizer(new colorizer('0;37', '41')))->define($runnerFailuresField = new fields\runner\failures\cli())->and($runnerFailuresField->setTitlePrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('0;31'))->setMethodPrompt(new prompt(' ', new colorizer('0;31'))))->define($runnerOutputsField = new fields\runner\outputs\cli())->and($runnerOutputsField->setTitlePrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('1;36'))->setMethodPrompt(new prompt(' ', new colorizer('1;36'))))->define($runnerErrorsField = new fields\runner\errors\cli())->and($runnerErrorsField->setTitlePrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('0;33'))->setMethodPrompt(new prompt(' ', new colorizer('0;33'))))->define($runnerExceptionsField = new fields\runner\exceptions\cli())->and($runnerExceptionsField->setTitlePrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('0;35'))->setMethodPrompt(new prompt(' ', new colorizer('0;35'))))->define($runnerUncompletedField = new fields\runner\tests\uncompleted\cli())->and($runnerUncompletedField->setTitlePrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('0;37'))->setMethodPrompt(new prompt(' ', new colorizer('0;37')))->setOutputPrompt(new prompt('  ', new colorizer('0;37'))))->define($runnerVoidField = new fields\runner\tests\void\cli())->and($runnerVoidField->setTitlePrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('0;34'))->setMethodPrompt(new prompt(' ', new colorizer('0;34'))))->define($runnerSkippedField = new fields\runner\tests\skipped\cli())->and($runnerSkippedField->setTitlePrompt(new prompt(PHP_EOL))->setTitleColorizer(new colorizer('0;90'))->setMethodPrompt(new prompt(' ', new colorizer('0;90'))))->define($testRunField = new fields\test\run\phing())->and($testRunField->setPrompt(new prompt(PHP_EOL))->setColorizer(new colorizer('1;36')))->define($testDurationField = new fields\test\duration\phing())->and($testDurationField->setPrompt(new prompt(' ', new colorizer('1;36'))))->define($testMemoryField = new fields\test\memory\phing())->and($testMemoryField->setPrompt(new prompt(' ', new colorizer('1;36'))))->if($report = new testedClass())->then->boolean($report->progressIsShowed())->isTrue()->boolean($report->codeCoverageIsShowed())->isTrue()->boolean($report->missingCodeCoverageIsShowed())->isTrue()->boolean($report->durationIsShowed())->isTrue()->boolean($report->memoryIsShowed())->isTrue()->variable($report->getCodeCoverageReportPath())->isNull()->variable($report->getCodeCoverageReportUrl())->isNull()->array($report->getFields())->isEqualTo(array($phpPathField, $phpVersionField, $runnerTestsDurationField, $runnerTestsMemoryField, $runnerTestsCoverageField, $runnerResultField, $runnerFailuresField, $runnerOutputsField, $runnerErrorsField, $runnerExceptionsField, $runnerUncompletedField, $runnerVoidField, $runnerSkippedField, $testRunField, new fields\test\event\phing(), $testDurationField, $testMemoryField));
 }