當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PHPUnit_TextUI_Command::run方法代碼示例

本文整理匯總了PHP中PHPUnit_TextUI_Command::run方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHPUnit_TextUI_Command::run方法的具體用法?PHP PHPUnit_TextUI_Command::run怎麽用?PHP PHPUnit_TextUI_Command::run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PHPUnit_TextUI_Command的用法示例。


在下文中一共展示了PHPUnit_TextUI_Command::run方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 /**
  * Call the same functions used by the CLI PHPUnit
  * to engage the tests
  * @param string $modulePath path to the phpunit.xml to use
  * @return int
  * 0: Tests successful
  * 1: Tests failed
  * 2: Failed with exception
  */
 public function run($modulePath, $params = array())
 {
     $runner = new \PHPUnit_TextUI_Command();
     $options = array('--configuration', $modulePath . '/phpunit.xml');
     if (isset($params['filter']) && !empty($params['filter'])) {
         $options[] = '--filter';
         $options[] = $params['filter'];
     }
     if (isset($params['coverage']) && !empty($params['coverage'])) {
         $coverage = $params['coverage'];
         $path = $this->getCoveragePath();
         switch ($coverage) {
             case 'html':
                 $options[] = '--coverage-html';
                 $path .= '/html';
                 $options[] = $path;
                 break;
             default:
                 $options[] = '--coverage-text';
                 break;
         }
         echo "Coverage data will be written to {$path}" . PHP_EOL;
     }
     array_unshift($options, 'phpunit');
     return $runner->run($options, false);
 }
開發者ID:linusshops,項目名稱:prophet,代碼行數:35,代碼來源:TestRunner.php

示例2: runTests

 public function runTests()
 {
     $cliOptions = ['phpunit'];
     // first entry is the command
     array_push($cliOptions, '-c', __QCUBED_CORE__ . '/tests/phpunit.xml');
     // the config file is here
     //		array_push($cliOptions, '--bootstrap', __QCUBED_CORE__ . '/../vendor/autoload.php');
     $tester = new PHPUnit_TextUI_Command();
     $tester->run($cliOptions);
 }
開發者ID:vaibhav-kaushal,項目名稱:qc-framework,代碼行數:10,代碼來源:test.php

示例3: execute

 public function execute()
 {
     global $IP;
     // NOTE (phuedx, 2014-03-26) wgAutoloadClasses isn't set up
     // by either of the dependencies at the top of the file, so
     // require it here.
     require_once __DIR__ . '/../tests/TestsAutoLoader.php';
     $textUICommand = new PHPUnit_TextUI_Command();
     $argv = array("{$IP}/tests/phpunit/phpunit.php", "{$IP}/tests/phpunit/suites/LessTestSuite.php");
     $textUICommand->run($argv);
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:11,代碼來源:checkLess.php

示例4: run

 /**
  * Read configuration file, and run check.
  *
  * @return void
  * @throws \Exception
  */
 public function run()
 {
     if (is_null($this->config)) {
         exit("Can not find a set of checks to run.\n");
     }
     PHP_Timer::start();
     $command = new \PHPUnit_TextUI_Command();
     $command->run(array('--configuration', $this->config, '--testdox'), false);
     $duration = PHP_Timer::stop();
     $c = new Color();
     echo $c('Time : ' . PHP_Timer::secondsToTimeString($duration))->bold() . PHP_EOL;
 }
開發者ID:attachmentgenie,項目名稱:testbench,代碼行數:18,代碼來源:TestRunner.php

示例5: execute

 /**
  * (non-PHPdoc)
  *
  * @see \SK\ITCBundle\Code\Generator\PHPUnit\AbstractGenerator::execute($input, $output)
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $this->writeHeader($output);
     if (strpos('/usr/bin/php', '@php_bin') === 0) {
         require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'PHPUnit' . DIRECTORY_SEPARATOR . 'Autoload.php';
     } else {
         require '/usr/share/pear' . DIRECTORY_SEPARATOR . 'PHPUnit' . DIRECTORY_SEPARATOR . 'Autoload.php';
     }
     $commandArg = array('-c' => "phpunit.xml");
     $command = new \PHPUnit_TextUI_Command();
     $command->run($commandArg);
 }
開發者ID:slavomirkuzma,項目名稱:itc-bundle,代碼行數:17,代碼來源:Run.php

示例6: run

 public function run(array $argv, $exit = true)
 {
     wfProfileIn(__METHOD__);
     $ret = parent::run($argv, false);
     wfProfileOut(__METHOD__);
     // Return to real wiki db, so profiling data is preserved
     MediaWikiTestCase::teardownTestDB();
     // Log profiling data, e.g. in the database or UDP
     wfLogProfilingData();
     if ($exit) {
         exit($ret);
     } else {
         return $ret;
     }
 }
開發者ID:biribogos,項目名稱:wikihow-src,代碼行數:15,代碼來源:MediaWikiPHPUnitCommand.php

示例7: phpunit

 /**
  * new method to launch a web server
  * @param array $options
  * @tutorial php bin/console server:run
  *           php bin/console server:run -a 192.168.0.1:8000
  */
 public function phpunit(array $options = array())
 {
     ob_get_clean();
     $files = scandir(__DIR__ . '/../../../../tests');
     foreach ($files as $one) {
         if (is_dir(__DIR__ . '/../../../../tests/' . $one) && $one != '..' && $one != '.') {
             $controllerFiles = scandir(__DIR__ . '/../../../../tests' . '/' . $one . '/app/Controller');
             foreach ($controllerFiles as $oneController) {
                 if (is_file(__DIR__ . '/../../../../tests/' . $one . '/app/Controller/' . $oneController) && $oneController != '..' && $oneController != '.') {
                     $unitTest = new \PHPUnit_TextUI_Command();
                     $unitTest->run([__DIR__ . '/../../../../tests/' . $one . '/app/Controller/' . $oneController]);
                 }
             }
         }
     }
 }
開發者ID:las93,項目名稱:venus3,代碼行數:22,代碼來源:Phpunit.php

示例8: main

 /**
  * Uses an instance of PHPUnit_TextUI_Command to execute the PHPUnit
  * tests and simulates any Mutagenesis supported command line options suitable
  * for PHPUnit. At present, we merely dissect a generic 'options' string
  * equivelant to anything typed into a console after a normal 'phpunit'
  * command. The adapter captures the TextUI output for further processing.
  *
  * To prevent duplication of output from stdout, PHPUnit is hard
  * configured to write to stderrm(stdin is used in proc_open call)
  *
  * @param array $arguments Mutagenesis arguments to pass to PHPUnit
  * @return void
  */
 public static function main(array $arguments, $useStdout = false)
 {
     if (!$useStdout) {
         array_unshift($arguments['clioptions'], '--stderr');
     }
     if (!in_array('--stop-on-failure', $arguments['clioptions'])) {
         array_unshift($arguments['clioptions'], '--stop-on-failure');
     }
     array_unshift($arguments['clioptions'], 'phpunit');
     $originalWorkingDirectory = getcwd();
     if (isset($arguments['tests'])) {
         chdir($arguments['tests']);
     }
     $command = new \PHPUnit_TextUI_Command();
     $command->run($arguments['clioptions'], false);
     chdir($originalWorkingDirectory);
 }
開發者ID:padraic,項目名稱:mutagenesis,代碼行數:30,代碼來源:Runner.php

示例9: execute

 public function execute()
 {
     global $IP;
     // NOTE (phuedx, 2014-03-26) wgAutoloadClasses isn't set up
     // by either of the dependencies at the top of the file, so
     // require it here.
     require_once __DIR__ . '/../tests/TestsAutoLoader.php';
     // If phpunit isn't available by autoloader try pulling it in
     if (!class_exists('PHPUnit_Framework_TestCase')) {
         require_once 'PHPUnit/Autoload.php';
     }
     // RequestContext::resetMain() will print warnings unless this
     // is defined.
     if (!defined('MW_PHPUNIT_TEST')) {
         define('MW_PHPUNIT_TEST', true);
     }
     $textUICommand = new PHPUnit_TextUI_Command();
     $argv = ["{$IP}/tests/phpunit/phpunit.php", "{$IP}/tests/phpunit/suites/LessTestSuite.php"];
     $textUICommand->run($argv);
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:20,代碼來源:checkLess.php

示例10: main

 /**
  * Uses an instance of PHPUnit_TextUI_Command to execute the PHPUnit
  * tests and simulates any Mutateme supported command line options suitable
  * for PHPUnit. At present, we merely dissect a generic 'options' string
  * equivelant to anything typed into a console after a normal 'phpunit'
  * command. The adapter captures the TextUI output for further processing.
  *
  * To prevent duplication of output from stdout, PHPUnit is hard
  * configured to write to stderrm(stdin is used in proc_open call)
  *
  * @param array $arguments Mutateme arguments to pass to PHPUnit
  * @return void
  */
 public static function main(array $arguments, $useStdout = false)
 {
     $optionString = 'phpunit';
     if ($useStdout) {
         $optionString .= '';
     } else {
         $optionString = ' --stderr';
     }
     if (isset($arguments['options'])) {
         $optionString .= ' ' . $arguments['options'];
     }
     $options = explode(' ', $optionString);
     $originalWorkingDirectory = getcwd();
     if (isset($arguments['tests'])) {
         chdir($arguments['tests']);
     }
     $command = new \PHPUnit_TextUI_Command();
     $command->run($options, false);
     chdir($originalWorkingDirectory);
 }
開發者ID:bergelmir,項目名稱:mutateme,代碼行數:33,代碼來源:Runner.php

示例11: run

 /**
  * @param array   $argv
  * @param boolean $exit
  */
 public function run(array $argv, $exit = true)
 {
     parent::run($argv, false);
 }
開發者ID:alexschwarz89,項目名稱:Barzahlen-OXID-4.7,代碼行數:8,代碼來源:OxidCommand.php

示例12: run

 public function run($options)
 {
     $phpunit = new \PHPUnit_TextUI_Command();
     $phpunit->run(['', 'tests/cases', '--bootstrap=tests/bootstrap.php']);
 }
開發者ID:ntentan,項目名稱:dev,代碼行數:5,代碼來源:Test.php

示例13: run_with_xml

 /**
  * Runs PHPUnit with the supplied XML configuration file.
  *
  * @param mixed $xml_config    The path to the PHPUnit XML configuration
  *                             file.
  * @access public
  * @return string
  */
 public function run_with_xml($xml_config, $extraConfiguration)
 {
     $command = new \PHPUnit_TextUI_Command();
     // We need to temporarily turn off html_errors to ensure correct
     // parsing of test debug output
     $html_errors = ini_get('html_errors');
     ini_set('html_errors', 0);
     ob_start();
     if (isset($extraConfiguration['use_group_name'])) {
         $command->run(array('--configuration', $xml_config, '--group', $extraConfiguration['use_group_name']), false);
     } else {
         if (isset($extraConfiguration['run_specific_test'])) {
             $command->run(array('--configuration', $xml_config, '--filter', $extraConfiguration['run_specific_test']), false);
         } else {
             $command->run(array('--configuration', $xml_config), false);
         }
     }
     $results = ob_get_contents();
     ob_end_clean();
     ini_set('html_errors', $html_errors);
     $start = strpos($results, '{');
     $end = strrpos($results, '}');
     return substr($results, $start, $end - $start + 1);
 }
開發者ID:nickl-,項目名稱:VisualPHPUnit,代碼行數:32,代碼來源:VPU.php

示例14: run_with_xml

 /**
  * Runs PHPUnit with the supplied XML configuration file.
  *
  * @param mixed $xml_config    The path to the PHPUnit XML configuration
  *                             file.
  * @access public
  * @return string
  */
 public function run_with_xml($xml_config)
 {
     $command = new \PHPUnit_TextUI_Command();
     // We need to temporarily turn off html_errors to ensure correct
     // parsing of test debug output
     $html_errors = ini_get('html_errors');
     ini_set('html_errors', 0);
     ob_start();
     $command->run(array('--configuration', $xml_config), false);
     $results = ob_get_contents();
     ob_end_clean();
     ini_set('html_errors', $html_errors);
     $start = strpos($results, '{');
     $end = strrpos($results, '}');
     return substr($results, $start, $end - $start + 1);
 }
開發者ID:ragtek,項目名稱:VisualPHPUnit,代碼行數:24,代碼來源:VPU.php

示例15: dirname

<?php

$base = dirname(__FILE__);
set_include_path("{$base}:{$base}/tests:" . get_include_path());
require_once 'PHPUnit/Util/Filter.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
require_once 'PHPUnit/TextUI/Command.php';
$command = new PHPUnit_TextUI_Command();
$command->run($argv);
開發者ID:localdisk,項目名稱:HTTP_OAuth,代碼行數:9,代碼來源:runTests.php


注:本文中的PHPUnit_TextUI_Command::run方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。