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 12if (version_compare('5.6.0', PHP_VERSION, '>')) { 13 fwrite( 14 STDERR, 15 sprintf( 16 'This version of PHPUnit is supported on PHP 5.6, PHP 7.0, and PHP 7.1.' . PHP_EOL . 17 'You are using PHP %s (%s).' . PHP_EOL, 18 PHP_VERSION, 19 PHP_BINARY 20 ) 21 ); 22 23 die(1); 24} 25 26if (!ini_get('date.timezone')) { 27 ini_set('date.timezone', 'UTC'); 28} 29 30foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) { 31 if (file_exists($file)) { 32 define('PHPUNIT_COMPOSER_INSTALL', $file); 33 34 break; 35 } 36} 37 38unset($file); 39 40if (!defined('PHPUNIT_COMPOSER_INSTALL')) { 41 fwrite(STDERR, 42 'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL . 43 ' composer install' . PHP_EOL . PHP_EOL . 44 'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL 45 ); 46 47 die(1); 48} 49 50require PHPUNIT_COMPOSER_INSTALL; 51 52PHPUnit_TextUI_Command::main(); 53