PageRenderTime 53ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/agavi/vendor/PHPUnit/TextUI/Command.php

https://github.com/digitarald/redracer
PHP | 804 lines | 604 code | 129 blank | 71 comment | 97 complexity | fd736c196bc44e35714833419a48e90f MD5 | raw file
Possible License(s): GPL-3.0, LGPL-2.1, GPL-2.0, BSD-3-Clause, Apache-2.0
  1. <?php
  2. /**
  3. * PHPUnit
  4. *
  5. * Copyright (c) 2002-2008, Sebastian Bergmann <sb@sebastian-bergmann.de>.
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * * Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. *
  15. * * Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in
  17. * the documentation and/or other materials provided with the
  18. * distribution.
  19. *
  20. * * Neither the name of Sebastian Bergmann nor the names of his
  21. * contributors may be used to endorse or promote products derived
  22. * from this software without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  27. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  28. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  29. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  30. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  31. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  32. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  33. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  34. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  35. * POSSIBILITY OF SUCH DAMAGE.
  36. *
  37. * @category Testing
  38. * @package PHPUnit
  39. * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
  40. * @copyright 2002-2008 Sebastian Bergmann <sb@sebastian-bergmann.de>
  41. * @license http://www.opensource.org/licenses/bsd-license.php BSD License
  42. * @version SVN: $Id: Command.php 4124 2008-11-24 04:44:50Z sb $
  43. * @link http://www.phpunit.de/
  44. * @since File available since Release 3.0.0
  45. */
  46. require_once 'PHPUnit/TextUI/TestRunner.php';
  47. require_once 'PHPUnit/Util/Configuration.php';
  48. require_once 'PHPUnit/Util/Fileloader.php';
  49. require_once 'PHPUnit/Util/Filter.php';
  50. require_once 'PHPUnit/Util/Getopt.php';
  51. PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
  52. if (!defined('PHPUnit_MAIN_METHOD')) {
  53. define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main');
  54. }
  55. /**
  56. * A TestRunner for the Command Line Interface (CLI)
  57. * PHP SAPI Module.
  58. *
  59. * @category Testing
  60. * @package PHPUnit
  61. * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
  62. * @copyright 2002-2008 Sebastian Bergmann <sb@sebastian-bergmann.de>
  63. * @license http://www.opensource.org/licenses/bsd-license.php BSD License
  64. * @version Release: @package_version@
  65. * @link http://www.phpunit.de/
  66. * @since Class available since Release 3.0.0
  67. */
  68. class PHPUnit_TextUI_Command
  69. {
  70. /**
  71. */
  72. public static function main($exit = TRUE)
  73. {
  74. $arguments = self::handleArguments();
  75. $runner = new PHPUnit_TextUI_TestRunner($arguments['loader']);
  76. if (is_object($arguments['test']) && $arguments['test'] instanceof PHPUnit_Framework_Test) {
  77. $suite = $arguments['test'];
  78. } else {
  79. $suite = $runner->getTest(
  80. $arguments['test'],
  81. $arguments['testFile'],
  82. $arguments['syntaxCheck']
  83. );
  84. }
  85. if ($suite->testAt(0) instanceof PHPUnit_Framework_Warning &&
  86. strpos($suite->testAt(0)->getMessage(), 'No tests found in class') !== FALSE) {
  87. require_once 'PHPUnit/Util/Skeleton/Test.php';
  88. if (isset($arguments['bootstrap'])) {
  89. PHPUnit_Util_Fileloader::load($arguments['bootstrap']);
  90. }
  91. $skeleton = new PHPUnit_Util_Skeleton_Test(
  92. $arguments['test'],
  93. $arguments['testFile']
  94. );
  95. $result = $skeleton->generate(TRUE);
  96. if (!$result['incomplete']) {
  97. eval(str_replace(array('<?php', '?>'), '', $result['code']));
  98. $suite = new PHPUnit_Framework_TestSuite($arguments['test'] . 'Test');
  99. }
  100. }
  101. if ($arguments['listGroups']) {
  102. PHPUnit_TextUI_TestRunner::printVersionString();
  103. print "Available test group(s):\n";
  104. $groups = $suite->getGroups();
  105. sort($groups);
  106. foreach ($groups as $group) {
  107. print " - $group\n";
  108. }
  109. exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
  110. }
  111. try {
  112. $result = $runner->doRun(
  113. $suite,
  114. $arguments
  115. );
  116. }
  117. catch (Exception $e) {
  118. throw new RuntimeException(
  119. 'Could not create and run test suite: ' . $e->getMessage()
  120. );
  121. }
  122. if ($exit) {
  123. if ($result->wasSuccessful()) {
  124. exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
  125. }
  126. else if ($result->errorCount() > 0) {
  127. exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
  128. }
  129. else {
  130. exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);
  131. }
  132. }
  133. }
  134. /**
  135. */
  136. protected static function handleArguments()
  137. {
  138. $arguments = array(
  139. 'listGroups' => FALSE,
  140. 'loader' => NULL,
  141. 'syntaxCheck' => TRUE
  142. );
  143. $longOptions = array(
  144. 'ansi',
  145. 'colors',
  146. 'bootstrap=',
  147. 'configuration=',
  148. 'coverage-html=',
  149. 'coverage-clover=',
  150. 'coverage-source=',
  151. 'coverage-xml=',
  152. 'debug',
  153. 'exclude-group=',
  154. 'filter=',
  155. 'group=',
  156. 'help',
  157. 'include-path=',
  158. 'list-groups',
  159. 'loader=',
  160. 'log-graphviz=',
  161. 'log-json=',
  162. 'log-metrics=',
  163. 'log-pmd=',
  164. 'log-tap=',
  165. 'log-xml=',
  166. 'process-isolation',
  167. 'repeat=',
  168. 'report=',
  169. 'skeleton',
  170. 'skeleton-class',
  171. 'skeleton-test',
  172. 'stop-on-failure',
  173. 'story',
  174. 'story-html=',
  175. 'story-text=',
  176. 'tap',
  177. 'test-db-dsn=',
  178. 'test-db-log-rev=',
  179. 'test-db-log-prefix=',
  180. 'test-db-log-info=',
  181. 'testdox',
  182. 'testdox-html=',
  183. 'testdox-text=',
  184. 'no-syntax-check',
  185. 'verbose',
  186. 'version',
  187. 'wait'
  188. );
  189. try {
  190. $options = PHPUnit_Util_Getopt::getopt(
  191. $_SERVER['argv'],
  192. 'd:',
  193. $longOptions
  194. );
  195. }
  196. catch (RuntimeException $e) {
  197. PHPUnit_TextUI_TestRunner::showError($e->getMessage());
  198. }
  199. if (isset($options[1][0])) {
  200. $arguments['test'] = $options[1][0];
  201. }
  202. if (isset($options[1][1])) {
  203. $arguments['testFile'] = $options[1][1];
  204. } else {
  205. $arguments['testFile'] = '';
  206. }
  207. if (isset($arguments['test']) && is_file($arguments['test'])) {
  208. $arguments['testFile'] = realpath($arguments['test']);
  209. $arguments['test'] = substr($arguments['test'], 0, strrpos($arguments['test'], '.'));
  210. }
  211. foreach ($options[0] as $option) {
  212. switch ($option[0]) {
  213. case '--ansi': {
  214. self::showMessage(
  215. 'The --ansi option is deprecated, please use --colors instead.',
  216. FALSE
  217. );
  218. }
  219. case '--colors': {
  220. $arguments['colors'] = TRUE;
  221. }
  222. break;
  223. case '--bootstrap': {
  224. $arguments['bootstrap'] = $option[1];
  225. }
  226. break;
  227. case '--configuration': {
  228. $arguments['configuration'] = $option[1];
  229. }
  230. break;
  231. case '--coverage-xml': {
  232. self::showMessage(
  233. 'The --coverage-xml option is deprecated, please use --coverage-clover instead.',
  234. FALSE
  235. );
  236. }
  237. case '--coverage-clover': {
  238. if (extension_loaded('tokenizer') && extension_loaded('xdebug')) {
  239. $arguments['coverageClover'] = $option[1];
  240. } else {
  241. if (!extension_loaded('tokenizer')) {
  242. self::showMessage('The tokenizer extension is not loaded.');
  243. } else {
  244. self::showMessage('The Xdebug extension is not loaded.');
  245. }
  246. }
  247. }
  248. break;
  249. case '--coverage-source': {
  250. if (extension_loaded('tokenizer') && extension_loaded('xdebug')) {
  251. $arguments['coverageSource'] = $option[1];
  252. } else {
  253. if (!extension_loaded('tokenizer')) {
  254. self::showMessage('The tokenizer extension is not loaded.');
  255. } else {
  256. self::showMessage('The Xdebug extension is not loaded.');
  257. }
  258. }
  259. }
  260. break;
  261. case '--report': {
  262. self::showMessage(
  263. 'The --report option is deprecated, please use --coverage-html instead.',
  264. FALSE
  265. );
  266. }
  267. case '--coverage-html': {
  268. if (extension_loaded('tokenizer') && extension_loaded('xdebug')) {
  269. $arguments['reportDirectory'] = $option[1];
  270. } else {
  271. if (!extension_loaded('tokenizer')) {
  272. self::showMessage('The tokenizer extension is not loaded.');
  273. } else {
  274. self::showMessage('The Xdebug extension is not loaded.');
  275. }
  276. }
  277. }
  278. break;
  279. case 'd': {
  280. $ini = explode('=', $option[1]);
  281. if (isset($ini[0])) {
  282. if (isset($ini[1])) {
  283. ini_set($ini[0], $ini[1]);
  284. } else {
  285. ini_set($ini[0], TRUE);
  286. }
  287. }
  288. }
  289. break;
  290. case '--debug': {
  291. $arguments['debug'] = TRUE;
  292. }
  293. break;
  294. case '--help': {
  295. self::showHelp();
  296. exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
  297. }
  298. break;
  299. case '--filter': {
  300. $arguments['filter'] = $option[1];
  301. }
  302. break;
  303. case '--group': {
  304. $arguments['groups'] = explode(',', $option[1]);
  305. }
  306. break;
  307. case '--exclude-group': {
  308. $arguments['excludeGroups'] = explode(',', $option[1]);
  309. }
  310. break;
  311. case '--include-path': {
  312. ini_set(
  313. 'include_path',
  314. $option[1] . PATH_SEPARATOR . ini_get('include_path')
  315. );
  316. }
  317. break;
  318. case '--list-groups': {
  319. $arguments['listGroups'] = TRUE;
  320. }
  321. break;
  322. case '--loader': {
  323. $arguments['loader'] = self::handleLoader($option[1]);
  324. }
  325. break;
  326. case '--log-json': {
  327. $arguments['jsonLogfile'] = $option[1];
  328. }
  329. break;
  330. case '--log-graphviz': {
  331. self::showMessage(
  332. 'The --log-graphviz functionality is deprecated and will be removed in the future.',
  333. FALSE
  334. );
  335. if (PHPUnit_Util_Filesystem::fileExistsInIncludePath('Image/GraphViz.php')) {
  336. $arguments['graphvizLogfile'] = $option[1];
  337. } else {
  338. self::showMessage('The Image_GraphViz package is not installed.');
  339. }
  340. }
  341. break;
  342. case '--log-tap': {
  343. $arguments['tapLogfile'] = $option[1];
  344. }
  345. break;
  346. case '--log-xml': {
  347. $arguments['xmlLogfile'] = $option[1];
  348. }
  349. break;
  350. case '--log-pmd': {
  351. self::showMessage(
  352. 'The --log-pmd functionality is deprecated and will be removed in the future.',
  353. FALSE
  354. );
  355. if (extension_loaded('tokenizer') && extension_loaded('xdebug')) {
  356. $arguments['pmdXML'] = $option[1];
  357. } else {
  358. if (!extension_loaded('tokenizer')) {
  359. self::showMessage('The tokenizer extension is not loaded.');
  360. } else {
  361. self::showMessage('The Xdebug extension is not loaded.');
  362. }
  363. }
  364. }
  365. break;
  366. case '--log-metrics': {
  367. self::showMessage(
  368. 'The --log-metrics functionality is deprecated and will be removed in the future.',
  369. FALSE
  370. );
  371. if (extension_loaded('tokenizer') && extension_loaded('xdebug')) {
  372. $arguments['metricsXML'] = $option[1];
  373. } else {
  374. if (!extension_loaded('tokenizer')) {
  375. self::showMessage('The tokenizer extension is not loaded.');
  376. } else {
  377. self::showMessage('The Xdebug extension is not loaded.');
  378. }
  379. }
  380. }
  381. break;
  382. case '--process-isolation': {
  383. $arguments['processIsolation'] = TRUE;
  384. $arguments['syntaxCheck'] = FALSE;
  385. }
  386. break;
  387. case '--repeat': {
  388. $arguments['repeat'] = (int)$option[1];
  389. }
  390. break;
  391. case '--stop-on-failure': {
  392. $arguments['stopOnFailure'] = TRUE;
  393. }
  394. break;
  395. case '--test-db-dsn': {
  396. if (extension_loaded('pdo')) {
  397. $arguments['testDatabaseDSN'] = $option[1];
  398. } else {
  399. self::showMessage('The PDO extension is not loaded.');
  400. }
  401. }
  402. break;
  403. case '--test-db-log-rev': {
  404. if (extension_loaded('pdo')) {
  405. $arguments['testDatabaseLogRevision'] = $option[1];
  406. } else {
  407. self::showMessage('The PDO extension is not loaded.');
  408. }
  409. }
  410. break;
  411. case '--test-db-prefix': {
  412. if (extension_loaded('pdo')) {
  413. $arguments['testDatabasePrefix'] = $option[1];
  414. } else {
  415. self::showMessage('The PDO extension is not loaded.');
  416. }
  417. }
  418. break;
  419. case '--test-db-log-info': {
  420. if (extension_loaded('pdo')) {
  421. $arguments['testDatabaseLogInfo'] = $option[1];
  422. } else {
  423. self::showMessage('The PDO extension is not loaded.');
  424. }
  425. }
  426. break;
  427. case '--skeleton': {
  428. self::showMessage(
  429. 'The --skeleton option is deprecated, please use --skeleton-test instead.',
  430. FALSE
  431. );
  432. }
  433. case '--skeleton-class':
  434. case '--skeleton-test': {
  435. if (isset($arguments['test']) && $arguments['test'] !== FALSE) {
  436. PHPUnit_TextUI_TestRunner::printVersionString();
  437. if (isset($arguments['bootstrap'])) {
  438. PHPUnit_Util_Fileloader::load($arguments['bootstrap']);
  439. }
  440. if ($option[0] == '--skeleton-class') {
  441. require_once 'PHPUnit/Util/Skeleton/Class.php';
  442. $class = 'PHPUnit_Util_Skeleton_Class';
  443. } else {
  444. require_once 'PHPUnit/Util/Skeleton/Test.php';
  445. $class = 'PHPUnit_Util_Skeleton_Test';
  446. }
  447. try {
  448. $skeleton = new $class($arguments['test'], $arguments['testFile']);
  449. $skeleton->write();
  450. }
  451. catch (Exception $e) {
  452. print $e->getMessage() . "\n";
  453. printf(
  454. 'Could not skeleton for "%s" to "%s".' . "\n",
  455. $skeleton->getOutClassName(),
  456. $skeleton->getOutSourceFile()
  457. );
  458. exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);
  459. }
  460. printf(
  461. 'Wrote skeleton for "%s" to "%s".' . "\n",
  462. $skeleton->getOutClassName(),
  463. $skeleton->getOutSourceFile()
  464. );
  465. exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
  466. } else {
  467. self::showHelp();
  468. exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
  469. }
  470. }
  471. break;
  472. case '--tap': {
  473. require_once 'PHPUnit/Util/Log/TAP.php';
  474. $arguments['printer'] = new PHPUnit_Util_Log_TAP;
  475. }
  476. break;
  477. case '--story': {
  478. require_once 'PHPUnit/Extensions/Story/ResultPrinter/Text.php';
  479. $arguments['printer'] = new PHPUnit_Extensions_Story_ResultPrinter_Text;
  480. }
  481. break;
  482. case '--story-html': {
  483. $arguments['storyHTMLFile'] = $option[1];
  484. }
  485. break;
  486. case '--story-text': {
  487. $arguments['storyTextFile'] = $option[1];
  488. }
  489. break;
  490. case '--testdox': {
  491. require_once 'PHPUnit/Util/TestDox/ResultPrinter/Text.php';
  492. $arguments['printer'] = new PHPUnit_Util_TestDox_ResultPrinter_Text;
  493. }
  494. break;
  495. case '--testdox-html': {
  496. $arguments['testdoxHTMLFile'] = $option[1];
  497. }
  498. break;
  499. case '--testdox-text': {
  500. $arguments['testdoxTextFile'] = $option[1];
  501. }
  502. break;
  503. case '--no-syntax-check': {
  504. $arguments['syntaxCheck'] = FALSE;
  505. }
  506. break;
  507. case '--verbose': {
  508. $arguments['verbose'] = TRUE;
  509. }
  510. break;
  511. case '--version': {
  512. PHPUnit_TextUI_TestRunner::printVersionString();
  513. exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
  514. }
  515. break;
  516. case '--wait': {
  517. $arguments['wait'] = TRUE;
  518. }
  519. break;
  520. }
  521. }
  522. if (!isset($arguments['configuration']) && file_exists('phpunit.xml')) {
  523. $arguments['configuration'] = realpath('phpunit.xml');
  524. }
  525. if (isset($arguments['configuration'])) {
  526. $configuration = PHPUnit_Util_Configuration::getInstance(
  527. $arguments['configuration']
  528. );
  529. $phpunit = $configuration->getPHPUnitConfiguration();
  530. if (isset($phpunit['testSuiteLoaderClass'])) {
  531. if (isset($phpunit['testSuiteLoaderFile'])) {
  532. $file = $phpunit['testSuiteLoaderFile'];
  533. } else {
  534. $file = '';
  535. }
  536. $arguments['loader'] = self::handleLoader(
  537. $phpunit['testSuiteLoaderClass'], $file
  538. );
  539. }
  540. $browsers = $configuration->getSeleniumBrowserConfiguration();
  541. if (!empty($browsers)) {
  542. require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
  543. PHPUnit_Extensions_SeleniumTestCase::$browsers = $browsers;
  544. }
  545. if (!isset($arguments['test'])) {
  546. $configuration->handlePHPConfiguration();
  547. if (isset($arguments['bootstrap'])) {
  548. PHPUnit_Util_Fileloader::load($arguments['bootstrap']);
  549. } else {
  550. $phpunitConfiguration = $configuration->getPHPUnitConfiguration();
  551. if ($phpunitConfiguration['bootstrap']) {
  552. PHPUnit_Util_Fileloader::load($phpunitConfiguration['bootstrap']);
  553. }
  554. }
  555. $testSuite = $configuration->getTestSuiteConfiguration();
  556. if ($testSuite !== NULL) {
  557. $arguments['test'] = $testSuite;
  558. }
  559. }
  560. }
  561. if (isset($arguments['test']) && is_string($arguments['test']) && substr($arguments['test'], -5, 5) == '.phpt') {
  562. require_once 'PHPUnit/Extensions/PhptTestCase.php';
  563. $test = new PHPUnit_Extensions_PhptTestCase($arguments['test']);
  564. $arguments['test'] = new PHPUnit_Framework_TestSuite;
  565. $arguments['test']->addTest($test);
  566. }
  567. if (!isset($arguments['test']) ||
  568. (isset($arguments['testDatabaseLogRevision']) && !isset($arguments['testDatabaseDSN']))) {
  569. self::showHelp();
  570. exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
  571. }
  572. return $arguments;
  573. }
  574. /**
  575. * @param string $loaderClass
  576. * @param string $loaderFile
  577. */
  578. protected static function handleLoader($loaderClass, $loaderFile = '')
  579. {
  580. if (!class_exists($loaderClass, FALSE)) {
  581. if ($loaderFile == '') {
  582. $loaderFile = str_replace('_', '/', $loaderClass) . '.php';
  583. }
  584. $loaderFile = PHPUnit_Util_Filesystem::fileExistsInIncludePath(
  585. $loaderFile
  586. );
  587. if ($loaderFile !== FALSE) {
  588. require $loaderFile;
  589. }
  590. }
  591. if (class_exists($loaderClass, FALSE)) {
  592. $class = new ReflectionClass($loaderClass);
  593. if ($class->implementsInterface('PHPUnit_Runner_TestSuiteLoader') &&
  594. $class->isInstantiable()) {
  595. $loader = $class->newInstance();
  596. }
  597. }
  598. if (!isset($loader)) {
  599. PHPUnit_TextUI_TestRunner::showError(
  600. sprintf(
  601. 'Could not use "%s" as loader.',
  602. $loaderClass
  603. )
  604. );
  605. }
  606. return $loader;
  607. }
  608. /**
  609. * @param string $message
  610. * @param boolean $exit
  611. */
  612. public static function showMessage($message, $exit = TRUE)
  613. {
  614. PHPUnit_TextUI_TestRunner::printVersionString();
  615. print $message . "\n";
  616. if ($exit) {
  617. exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
  618. } else {
  619. print "\n";
  620. }
  621. }
  622. /**
  623. */
  624. public static function showHelp()
  625. {
  626. PHPUnit_TextUI_TestRunner::printVersionString();
  627. print <<<EOT
  628. Usage: phpunit [switches] UnitTest [UnitTest.php]
  629. phpunit [switches] <directory>
  630. --log-json <file> Log test execution in JSON format.
  631. --log-tap <file> Log test execution in TAP format to file.
  632. --log-xml <file> Log test execution in XML format to file.
  633. --coverage-html <dir> Generate code coverage report in HTML format.
  634. --coverage-clover <file> Write code coverage data in Clover XML format.
  635. --coverage-source <dir> Write code coverage / source data in XML format.
  636. --test-db-dsn <dsn> DSN for the test database.
  637. --test-db-log-rev <rev> Revision information for database logging.
  638. --test-db-prefix ... Prefix that should be stripped from filenames.
  639. --test-db-log-info ... Additional information for database logging.
  640. --story-html <file> Write Story/BDD results in HTML format to file.
  641. --story-text <file> Write Story/BDD results in Text format to file.
  642. --testdox-html <file> Write agile documentation in HTML format to file.
  643. --testdox-text <file> Write agile documentation in Text format to file.
  644. --filter <pattern> Filter which tests to run.
  645. --group ... Only runs tests from the specified group(s).
  646. --exclude-group ... Exclude tests from the specified group(s).
  647. --list-groups List available test groups.
  648. --loader <loader> TestSuiteLoader implementation to use.
  649. --repeat <times> Runs the test(s) repeatedly.
  650. --story Report test execution progress in Story/BDD format.
  651. --tap Report test execution progress in TAP format.
  652. --testdox Report test execution progress in TestDox format.
  653. --colors Use colors in output.
  654. --no-syntax-check Disable syntax check of test source files.
  655. --stop-on-failure Stop execution upon first error or failure.
  656. --verbose Output more verbose information.
  657. --wait Waits for a keystroke after each test.
  658. --skeleton-class Generate Unit class for UnitTest in UnitTest.php.
  659. --skeleton-test Generate UnitTest class for Unit in Unit.php.
  660. --help Prints this usage information.
  661. --version Prints the version and exits.
  662. --bootstrap <file> A "bootstrap" PHP file that is run before the tests.
  663. --configuration <file> Read configuration from XML file.
  664. --process-isolation Run each test in a separate PHP process.
  665. --include-path <path(s)> Prepend PHP's include_path with given path(s).
  666. -d key[=value] Sets a php.ini value.
  667. EOT;
  668. }
  669. }
  670. if (PHPUnit_MAIN_METHOD == 'PHPUnit_TextUI_Command::main') {
  671. PHPUnit_TextUI_Command::main();
  672. }
  673. ?>