phpunit 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env php
  2. <?php
  3. /*
  4. * This file is part of PHPUnit.
  5. *
  6. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. if (version_compare('5.3.3', PHP_VERSION, '>')) {
  12. fwrite(
  13. STDERR,
  14. 'This version of PHPUnit requires PHP 5.3.3; using the latest version of PHP is highly recommended.' . PHP_EOL
  15. );
  16. die(1);
  17. }
  18. if (!ini_get('date.timezone')) {
  19. ini_set('date.timezone', 'UTC');
  20. }
  21. foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
  22. if (file_exists($file)) {
  23. define('PHPUNIT_COMPOSER_INSTALL', $file);
  24. break;
  25. }
  26. }
  27. unset($file);
  28. if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
  29. fwrite(STDERR,
  30. 'You need to set up the project dependencies using the following commands:' . PHP_EOL .
  31. 'wget http://getcomposer.org/composer.phar' . PHP_EOL .
  32. 'php composer.phar install' . PHP_EOL
  33. );
  34. die(1);
  35. }
  36. require PHPUNIT_COMPOSER_INSTALL;
  37. PHPUnit_TextUI_Command::main();