AllTests.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package UnitTests
  17. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. * @version $Id$
  20. */
  21. if (!defined('PHPUnit_MAIN_METHOD')) {
  22. define('PHPUnit_MAIN_METHOD', 'AllTests::main');
  23. }
  24. /**
  25. * Test helper
  26. */
  27. require_once 'TestHelper.php';
  28. /**
  29. * @see Zend_AllTests
  30. */
  31. require_once 'Zend/AllTests.php';
  32. class AllTests
  33. {
  34. public static function main()
  35. {
  36. $parameters = array();
  37. if (TESTS_GENERATE_REPORT && extension_loaded('xdebug')) {
  38. $parameters['reportDirectory'] = TESTS_GENERATE_REPORT_TARGET;
  39. }
  40. if (defined('TESTS_ZEND_LOCALE_FORMAT_SETLOCALE') && TESTS_ZEND_LOCALE_FORMAT_SETLOCALE) {
  41. // run all tests in a special locale
  42. setlocale(LC_ALL, TESTS_ZEND_LOCALE_FORMAT_SETLOCALE);
  43. }
  44. // Run buffered tests as a separate suite first
  45. ob_start();
  46. PHPUnit_TextUI_TestRunner::run(self::suiteBuffered(), $parameters);
  47. if (ob_get_level()) {
  48. ob_end_flush();
  49. }
  50. PHPUnit_TextUI_TestRunner::run(self::suite(), $parameters);
  51. }
  52. /**
  53. * Buffered test suites
  54. *
  55. * These tests require no output be sent prior to running as they rely
  56. * on internal PHP functions.
  57. *
  58. * @return PHPUnit_Framework_TestSuite
  59. */
  60. public static function suiteBuffered()
  61. {
  62. $suite = new PHPUnit_Framework_TestSuite('Zend Framework - Buffered');
  63. $suite->addTest(Zend_AllTests::suiteBuffered());
  64. return $suite;
  65. }
  66. /**
  67. * Regular suite
  68. *
  69. * All tests except those that require output buffering.
  70. *
  71. * @return PHPUnit_Framework_TestSuite
  72. */
  73. public static function suite()
  74. {
  75. $suite = new PHPUnit_Framework_TestSuite('Zend Framework');
  76. $suite->addTest(Zend_AllTests::suite());
  77. return $suite;
  78. }
  79. }
  80. if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
  81. AllTests::main();
  82. }