Skip to content

Commit 30cb995

Browse files
kornrunnerclaude
andcommitted
Add GitHub Actions CI workflow, require PHP 8.3+, and upgrade to PHPUnit 10
- Add GitHub Actions workflow for running tests on PRs and pushes - Workflow runs PHPUnit tests in PHP 8.3 containers using ubuntu-latest runners - Update minimum PHP requirement to 8.3 - Add platform config to lock dependencies to PHP 8.3 compatibility - Upgrade PHPUnit from 8.5 to 10.5 - Migrate PHPUnit configuration to latest schema - Add .phpunit.cache to .gitignore - All tests pass successfully with no deprecation warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent d4a81d4 commit 30cb995

File tree

6 files changed

+743
-394
lines changed

6 files changed

+743
-394
lines changed

.github/workflows/run-tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Run Tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.php'
7+
- '.github/workflows/**'
8+
- 'composer.json'
9+
- 'phpunit.xml.dist'
10+
push:
11+
branches:
12+
- develop
13+
- master
14+
paths:
15+
- '**.php'
16+
workflow_dispatch:
17+
18+
jobs:
19+
tests:
20+
name: PHPUnit Tests
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: '8.3'
31+
extensions: curl
32+
coverage: none
33+
34+
- name: Install dependencies
35+
run: composer install --no-interaction --prefer-dist
36+
37+
- name: Run tests
38+
run: bin/phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,4 @@ fabric.properties
142142
# *.ipr
143143

144144
# End of https://www.gitignore.io/api/linux,eclipse,phpstorm,netbeans,composer
145+
.phpunit.cache/

bin/php-parse

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

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
}
1818
],
1919
"require" : {
20-
"php" : ">=8",
20+
"php" : "^8.3",
2121
"ext-curl" : "*",
2222
"symfony/console" : "~5 || ~6 || ~7"
2323
},
2424
"require-dev" : {
25-
"phpunit/phpunit" : "~8"
25+
"phpunit/phpunit" : "^10.0"
2626
},
2727
"autoload" : {
2828
"psr-4" : {
@@ -32,6 +32,9 @@
3232
"license" : "MIT",
3333
"minimum-stability" : "stable",
3434
"config" : {
35-
"bin-dir" : "bin"
35+
"bin-dir" : "bin",
36+
"platform" : {
37+
"php" : "8.3.0"
38+
}
3639
}
3740
}

0 commit comments

Comments
 (0)