From 25a528d76e3506977ed6ae239e2a5b9236a57ec8 Mon Sep 17 00:00:00 2001 From: Martijn van der Lee Date: Sun, 2 Aug 2026 09:37:50 +0200 Subject: [PATCH 1/9] Support current PHPUnit releases --- composer.json | 59 +++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/composer.json b/composer.json index c8c8f15..220f584 100644 --- a/composer.json +++ b/composer.json @@ -1,30 +1,33 @@ { - "name": "vanderlee/swaggergen", - "description": "Generate Swagger/OpenAPI documentation from simple PHPdoc-like comments in PHP source code.", - "type": "library", - "keywords": ["swagger", "openapi", "doc", "documentation", "rest", "api", "documentor", "comments", "generate", "generator"], - "homepage": "https://github.com/vanderlee/PHPSwaggerGen", - "license": "MIT", - "support": { - "issues": "https://github.com/vanderlee/PHPSwaggerGen/issues", - "source": "https://github.com/vanderlee/PHPSwaggerGen/" - }, - "require": { - "php": ">=8.0", - "ext-json": "*", - "ext-tokenizer": "*", - "ext-filter": "*", - "ext-mbstring": "*" - }, - "suggest": { - "ext-yaml": "Allows producing Swagger docs in Yaml format" - }, - "autoload": { - "psr-4": { - "SwaggerGen\\": "SwaggerGen/" - } - }, - "require-dev": { - "phpunit/phpunit": "10" - } + "name": "vanderlee/swaggergen", + "description": "Generate Swagger/OpenAPI documentation from simple PHPdoc-like comments in PHP source code.", + "type": "library", + "keywords": ["swagger", "openapi", "doc", "documentation", "rest", "api", "documentor", "comments", "generate", "generator"], + "homepage": "https://github.com/vanderlee/PHPSwaggerGen", + "license": "MIT", + "support": { + "issues": "https://github.com/vanderlee/PHPSwaggerGen/issues", + "source": "https://github.com/vanderlee/PHPSwaggerGen/" + }, + "require": { + "php": ">=8.0", + "ext-json": "*", + "ext-tokenizer": "*", + "ext-filter": "*", + "ext-mbstring": "*" + }, + "suggest": { + "ext-yaml": "Allows producing Swagger docs in YAML format" + }, + "autoload": { + "psr-4": { + "SwaggerGen\\": "SwaggerGen/" + } + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^10.5 || ^11.5" + }, + "scripts": { + "test": "phpunit" + } } From 3b1a94e12b63e3c297fdaaaa043bedbcc979b04b Mon Sep 17 00:00:00 2001 From: Martijn van der Lee Date: Sun, 2 Aug 2026 09:37:59 +0200 Subject: [PATCH 2/9] Add current PHP test matrix --- .github/workflows/tests.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..95c73b9 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,42 @@ +name: Tests + +on: + pull_request: + push: + branches: + - master + workflow_dispatch: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.0', '8.1', '8.2', '8.3', '8.4'] + + name: PHP ${{ matrix.php }} + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json, tokenizer, filter, mbstring + tools: composer:v2 + coverage: none + + - name: Validate Composer metadata + run: composer validate --strict + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist + + - name: Run tests + run: composer test From 2ad1c4e5a6061faaf87a1655c01435ef30b42218 Mon Sep 17 00:00:00 2001 From: Martijn van der Lee Date: Sun, 2 Aug 2026 09:38:05 +0200 Subject: [PATCH 3/9] Remove obsolete Travis configuration --- .travis.yml | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 09eb8a4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: php -dist: trusty -php: - - 7.1 - - 7.2 - - hhvm -matrix: - allow_failures: - - php: hhvm From 28b50175844222fb02c2bee2a1aaf19279182c43 Mon Sep 17 00:00:00 2001 From: Martijn van der Lee Date: Sun, 2 Aug 2026 09:48:39 +0200 Subject: [PATCH 4/9] Test PHP 8.5 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 95c73b9..2688f09 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} From 7eb74c630d24dcd7b757471b80cefbf5671947f2 Mon Sep 17 00:00:00 2001 From: Martijn van der Lee Date: Mon, 3 Aug 2026 10:06:47 +0200 Subject: [PATCH 5/9] Restore the PHPUnit test base alias --- tests/bootstrap.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3ca9812..e13b507 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,5 +1,9 @@ Date: Mon, 3 Aug 2026 10:07:02 +0200 Subject: [PATCH 6/9] Use the maintained checkout action --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2688f09..0ffab46 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up PHP uses: shivammathur/setup-php@v2 From ae30aa5e61616e8524edb66baa8df98ec19d3f7f Mon Sep 17 00:00:00 2001 From: Martijn van der Lee Date: Mon, 3 Aug 2026 10:08:55 +0200 Subject: [PATCH 7/9] Remove obsolete PHPUnit XML attributes --- phpunit.xml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 7fec2bd..bfc0238 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,12 +1,10 @@ - - - - - tests - - - \ No newline at end of file + + + + + tests + + + From 5a3625c1c5ba02ad9b2486de4790b25804248ab9 Mon Sep 17 00:00:00 2001 From: Martijn van der Lee Date: Mon, 3 Aug 2026 10:12:49 +0200 Subject: [PATCH 8/9] Make the output data provider static --- tests/output/OutputTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/output/OutputTest.php b/tests/output/OutputTest.php index 4845588..3eee0aa 100644 --- a/tests/output/OutputTest.php +++ b/tests/output/OutputTest.php @@ -15,7 +15,7 @@ public function testAllCases($name, $files, $expected) { $SwaggerGen = new SwaggerGen('example.com', '/base'); $actual = $SwaggerGen->getSwagger($files, array(), SwaggerGen::FORMAT_JSON); - $this->assertJsonStringEqualsJsonString($expected, $this->normalizeJson($actual), $name); + $this->assertJsonStringEqualsJsonString($expected, self::normalizeJson($actual), $name); } /** @@ -26,7 +26,7 @@ public function testAllCases($name, $files, $expected) * @param string $json * @return string */ - private function normalizeJson($json) + private static function normalizeJson($json) { return json_encode( json_decode($json), @@ -34,13 +34,13 @@ private function normalizeJson($json) ); } - public function provideAllCases() + public static function provideAllCases() { $cases = array(); foreach (glob(__DIR__ . '/*', GLOB_ONLYDIR) as $dir) { $path = realpath($dir); - $json = $this->normalizeJson(file_get_contents($path . '/expected.json')); + $json = self::normalizeJson(file_get_contents($path . '/expected.json')); $files = array(); if (file_exists($path . '/source.php')) { From 523bf015f6c65b79eeea3cdbac6abc61c39329e6 Mon Sep 17 00:00:00 2001 From: Martijn van der Lee Date: Mon, 3 Aug 2026 10:15:48 +0200 Subject: [PATCH 9/9] Make the pretty JSON assertion PHPUnit 9 compatible --- tests/SwaggerGenTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/SwaggerGenTest.php b/tests/SwaggerGenTest.php index df71b38..fd3e4d6 100644 --- a/tests/SwaggerGenTest.php +++ b/tests/SwaggerGenTest.php @@ -92,7 +92,7 @@ public function testGetSwagger_JSON_Pretty() response 202 '), array(), SwaggerGen::FORMAT_JSON_PRETTY); - $this->assertStringEqualsStringIgnoringLineEndings(<<assertSame($normalizeLineEndings($expected), $normalizeLineEndings($output)); } /**