AllTests.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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_Locale
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. if (!defined('PHPUnit_MAIN_METHOD')) {
  23. define('PHPUnit_MAIN_METHOD', 'Zend_Locale_AllTests::main');
  24. }
  25. if (!defined('TESTS_ZEND_LOCALE_FORMAT_SETLOCALE')) {
  26. /**
  27. * Read in user-defined test configuration if available; otherwise, read default test configuration.
  28. * This facilitates running "php AllTests.php" in this subdirectory or "phpunit Zend_Locale_AllTests".
  29. */
  30. $_test_configuration = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..'
  31. . DIRECTORY_SEPARATOR . 'TestConfiguration.php';
  32. if (is_readable($_test_configuration)) {
  33. include_once $_test_configuration;
  34. } else if (is_readable("$_test_configuration.dist")) {
  35. include_once "$_test_configuration.dist";
  36. }
  37. }
  38. require_once dirname(__FILE__) . '/../../TestHelper.php';
  39. // define('TESTS_ZEND_LOCALE_BCMATH_ENABLED', false); // uncomment to disable use of bcmath extension by Zend_Date
  40. require_once 'Zend/Locale/DataTest.php';
  41. require_once 'Zend/Locale/FormatTest.php';
  42. require_once 'Zend/Locale/MathTest.php';
  43. // echo "BCMATH is ", Zend_Locale_Math::isBcmathDisabled() ? 'disabled':'not disabled', "\n";
  44. /**
  45. * @category Zend
  46. * @package Zend_Locale
  47. * @subpackage UnitTests
  48. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  49. * @license http://framework.zend.com/license/new-bsd New BSD License
  50. * @group Zend_Locale
  51. */
  52. class Zend_Locale_AllTests
  53. {
  54. public static function main()
  55. {
  56. if (defined('TESTS_ZEND_LOCALE_FORMAT_SETLOCALE') && TESTS_ZEND_LOCALE_FORMAT_SETLOCALE) {
  57. // run all tests in a special locale
  58. setlocale(LC_ALL, TESTS_ZEND_LOCALE_FORMAT_SETLOCALE);
  59. }
  60. PHPUnit_TextUI_TestRunner::run(self::suite());
  61. }
  62. public static function suite()
  63. {
  64. $suite = new PHPUnit_Framework_TestSuite('Zend Framework - Zend_Locale');
  65. $suite->addTestSuite('Zend_Locale_DataTest');
  66. $suite->addTestSuite('Zend_Locale_FormatTest');
  67. $suite->addTestSuite('Zend_Locale_MathTest');
  68. return $suite;
  69. }
  70. }
  71. if (PHPUnit_MAIN_METHOD == 'Zend_Locale_AllTests::main') {
  72. Zend_Locale_AllTests::main();
  73. }