Skip to content

Commit 32cdf6e

Browse files
authored
Include PHPUnit 10 test with inclusion Parser.php (#10)
1 parent c1f9396 commit 32cdf6e

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.github/workflows/compat_tests.yaml.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
actions:
15+
-
16+
name: 'Rector dev + PHPUnit 10'
17+
run: composer require "phpunit/phpunit:10.*" -W
18+
php: 8.2
1519
-
1620
name: 'Rector dev + PHPUnit 11'
1721
run: composer require "phpunit/phpunit:11.*" -W

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Tests for compatibility with PHPStand and PHPUnit preload magic",
44
"require-dev": {
55
"php": "^8.2",
6-
"phpunit/phpunit": "11.*|12.*",
6+
"phpunit/phpunit": "10.*|11.*|12.*",
77
"rector/rector": "dev-main",
88
"phpstan/phpstan": "^2.1"
99
},
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace BBurnichon\RectorIssue9437\Tests;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use PHPUnit\Runner\Version;
7+
8+
final class ConflictingPhpParserLibraryTest extends TestCase
9+
{
10+
public function testItShouldNotConflictWhenIncludingPhpParserManually(): void
11+
{
12+
if (Version::id() >= 12) {
13+
$this->markTestSkipped('This test requires PHPUnit < 12');
14+
}
15+
16+
include_once dirname(__DIR__, 1) . '/vendor/nikic/php-parser/lib/PhpParser/Parser.php';
17+
18+
$this->assertTrue(true);
19+
}
20+
}

0 commit comments

Comments
 (0)