AllTests.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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) 2006 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. class Zend_Locale_AllTests
  45. {
  46. public static function main()
  47. {
  48. if (defined('TESTS_ZEND_LOCALE_FORMAT_SETLOCALE') && TESTS_ZEND_LOCALE_FORMAT_SETLOCALE) {
  49. // run all tests in a special locale
  50. setlocale(LC_ALL, TESTS_ZEND_LOCALE_FORMAT_SETLOCALE);
  51. }
  52. PHPUnit_TextUI_TestRunner::run(self::suite());
  53. }
  54. public static function suite()
  55. {
  56. $suite = new PHPUnit_Framework_TestSuite('Zend Framework - Zend_Locale');
  57. $suite->addTestSuite('Zend_Locale_DataTest');
  58. $suite->addTestSuite('Zend_Locale_FormatTest');
  59. $suite->addTestSuite('Zend_Locale_MathTest');
  60. return $suite;
  61. }
  62. }
  63. if (PHPUnit_MAIN_METHOD == 'Zend_Locale_AllTests::main') {
  64. Zend_Locale_AllTests::main();
  65. }