Skip to content

Commit d31a8ce

Browse files
committed
feat: allow PHPUnit 10-12
1 parent 9203935 commit d31a8ce

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
## [3.1.2] - 2025-11-11
1111

1212
- Allow PHPUnit > 9
13-
- Removed PhpUnitBackwardCompatibleTrait
13+
- Deprecate PhpUnitBackwardCompatibleTrait
1414

1515
## [3.1.1] - 2024-09-01
1616

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Http\Client\Tests;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
/**
8+
* @deprecated
9+
*/
10+
trait PhpUnitBackwardCompatibleTrait
11+
{
12+
public static function assertStringContainsString(string $needle, string $haystack, string $message = ''): void
13+
{
14+
// For supporting both phpunit 7 and 8 without display any deprecation.
15+
if (method_exists(TestCase::class, 'assertStringContainsString')) {
16+
parent::assertStringContainsString($needle, $haystack, $message);
17+
} else {
18+
parent::assertContains($needle, $haystack, $message);
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)