phpunit 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #!/usr/bin/env php
  2. <?php
  3. /**
  4. * Proxy PHP file generated by Composer
  5. *
  6. * This file includes the referenced bin path (../phpunit/phpunit/phpunit)
  7. * using a stream wrapper to prevent the shebang from being output on PHP<8
  8. *
  9. * @generated
  10. */
  11. namespace Composer;
  12. $GLOBALS['_composer_bin_dir'] = __DIR__;
  13. $GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
  14. $GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST'] = $GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST'] = array(realpath(__DIR__ . '/..'.'/phpunit/phpunit/phpunit'));
  15. if (PHP_VERSION_ID < 80000) {
  16. if (!class_exists('Composer\BinProxyWrapper')) {
  17. /**
  18. * @internal
  19. */
  20. final class BinProxyWrapper
  21. {
  22. private $handle;
  23. private $position;
  24. private $realpath;
  25. public function stream_open($path, $mode, $options, &$opened_path)
  26. {
  27. // get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
  28. $opened_path = substr($path, 17);
  29. $this->realpath = realpath($opened_path) ?: $opened_path;
  30. $opened_path = 'phpvfscomposer://'.$this->realpath;
  31. $this->handle = fopen($this->realpath, $mode);
  32. $this->position = 0;
  33. return (bool) $this->handle;
  34. }
  35. public function stream_read($count)
  36. {
  37. $data = fread($this->handle, $count);
  38. if ($this->position === 0) {
  39. $data = preg_replace('{^#!.*\r?\n}', '', $data);
  40. }
  41. $data = str_replace('__DIR__', var_export(dirname($this->realpath), true), $data);
  42. $data = str_replace('__FILE__', var_export($this->realpath, true), $data);
  43. $this->position += strlen($data);
  44. return $data;
  45. }
  46. public function stream_cast($castAs)
  47. {
  48. return $this->handle;
  49. }
  50. public function stream_close()
  51. {
  52. fclose($this->handle);
  53. }
  54. public function stream_lock($operation)
  55. {
  56. return $operation ? flock($this->handle, $operation) : true;
  57. }
  58. public function stream_seek($offset, $whence)
  59. {
  60. if (0 === fseek($this->handle, $offset, $whence)) {
  61. $this->position = ftell($this->handle);
  62. return true;
  63. }
  64. return false;
  65. }
  66. public function stream_tell()
  67. {
  68. return $this->position;
  69. }
  70. public function stream_eof()
  71. {
  72. return feof($this->handle);
  73. }
  74. public function stream_stat()
  75. {
  76. return array();
  77. }
  78. public function stream_set_option($option, $arg1, $arg2)
  79. {
  80. return true;
  81. }
  82. public function url_stat($path, $flags)
  83. {
  84. $path = substr($path, 17);
  85. if (file_exists($path)) {
  86. return stat($path);
  87. }
  88. return false;
  89. }
  90. }
  91. }
  92. if (
  93. (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
  94. || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
  95. ) {
  96. include("phpvfscomposer://" . __DIR__ . '/..'.'/phpunit/phpunit/phpunit');
  97. exit(0);
  98. }
  99. }
  100. include __DIR__ . '/..'.'/phpunit/phpunit/phpunit';