PageRenderTime 51ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/AllTests.php

https://bitbucket.org/ksekar/campus
PHP | 99 lines | 41 code | 14 blank | 44 comment | 8 complexity | cb8ebc2eacc1b716c4a69d69c4e9fc4a MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.0, MIT
  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 Zend
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: AllTests.php 24594 2012-01-05 21:27:01Z matthew $
  21. */
  22. if (!defined('PHPUnit_MAIN_METHOD')) {
  23. define('PHPUnit_MAIN_METHOD', 'AllTests::main');
  24. }
  25. require_once 'Zend/AllTests.php';
  26. require_once 'resources/AllTests.php';
  27. /**
  28. * @category Zend
  29. * @package Zend
  30. * @subpackage UnitTests
  31. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  32. * @license http://framework.zend.com/license/new-bsd New BSD License
  33. */
  34. class AllTests
  35. {
  36. public static function main()
  37. {
  38. $parameters = array();
  39. if (TESTS_GENERATE_REPORT && extension_loaded('xdebug')) {
  40. $parameters['reportDirectory'] = TESTS_GENERATE_REPORT_TARGET;
  41. }
  42. if (defined('TESTS_ZEND_LOCALE_FORMAT_SETLOCALE') && TESTS_ZEND_LOCALE_FORMAT_SETLOCALE) {
  43. // run all tests in a special locale
  44. setlocale(LC_ALL, TESTS_ZEND_LOCALE_FORMAT_SETLOCALE);
  45. }
  46. // Run buffered tests as a separate suite first
  47. ob_start();
  48. PHPUnit_TextUI_TestRunner::run(self::suiteBuffered(), $parameters);
  49. if (ob_get_level()) {
  50. ob_end_flush();
  51. }
  52. PHPUnit_TextUI_TestRunner::run(self::suite(), $parameters);
  53. }
  54. /**
  55. * Buffered test suites
  56. *
  57. * These tests require no output be sent prior to running as they rely
  58. * on internal PHP functions.
  59. *
  60. * @return PHPUnit_Framework_TestSuite
  61. */
  62. public static function suiteBuffered()
  63. {
  64. $suite = new PHPUnit_Framework_TestSuite('Zend Framework - Buffered');
  65. $suite->addTest(Zend_AllTests::suiteBuffered());
  66. return $suite;
  67. }
  68. /**
  69. * Regular suite
  70. *
  71. * All tests except those that require output buffering.
  72. *
  73. * @return PHPUnit_Framework_TestSuite
  74. */
  75. public static function suite()
  76. {
  77. $suite = new PHPUnit_Framework_TestSuite('Zend Framework');
  78. $suite->addTest(Zend_AllTests::suite());
  79. $suite->addTest(resources_AllTests::suite());
  80. return $suite;
  81. }
  82. }
  83. if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
  84. AllTests::main();
  85. }