From 3550bdcb67cfcf17897aba3ad81563c9e0f05253 Mon Sep 17 00:00:00 2001 From: Kalle Fagerberg Date: Sun, 7 Aug 2022 17:53:01 +0200 Subject: [PATCH] Ran composer update Composer was complaining about "composer.json" being outdated, and it didn't want to install PHPUnit, even though it was listed in compose.lock EDIT: While rebasing I mostly reverted most of my changes to instead use the upstream changes from main. --- .gitignore | 2 +- composer.json | 5 +- vendor/bin/phpunit | 124 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 128 insertions(+), 3 deletions(-) mode change 120000 => 100755 vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index 9012bc7..17ce6df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -vendor/ +vendor/* node_modules/ js/ diff --git a/composer.json b/composer.json index d47a04b..d7ef5a9 100644 --- a/composer.json +++ b/composer.json @@ -6,5 +6,8 @@ { "name": "thrillfall" } - ] + ], + "require-dev": { + "phpunit/phpunit": "^9" + } } diff --git a/vendor/bin/phpunit b/vendor/bin/phpunit deleted file mode 120000 index 2c48930..0000000 --- a/vendor/bin/phpunit +++ /dev/null @@ -1 +0,0 @@ -../phpunit/phpunit/phpunit \ No newline at end of file diff --git a/vendor/bin/phpunit b/vendor/bin/phpunit new file mode 100755 index 0000000..e92cddc --- /dev/null +++ b/vendor/bin/phpunit @@ -0,0 +1,123 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = 'phpvfscomposer://'.$this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + $data = str_replace('__DIR__', var_export(dirname($this->realpath), true), $data); + $data = str_replace('__FILE__', var_export($this->realpath, true), $data); + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/phpunit/phpunit/phpunit'); + exit(0); + } +} + +include __DIR__ . '/..'.'/phpunit/phpunit/phpunit';