Skip to content

Commit 107b159

Browse files
Merge pull request #1489 from Jean85/allow-phpunit-12-7.x
[7.x] Allow phpunit 12
2 parents b9425fa + 097967f commit 107b159

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

CHANGES-v7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [7.6.0]
88

99
### Added
10-
- PHPUnit 11 compatibility [@Jean85](https://github.com/Jean85)
10+
- PHPUnit 11 & 12 compatibility [@Jean85](https://github.com/Jean85)
1111

1212
## [7.5.0]
1313

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"php": "^7.3 || 8.0.* || 8.1.* || 8.2.* || 8.3.*",
2626
"phpspec/prophecy": "^1.9",
2727
"phpspec/php-diff": "^1.0.0",
28-
"sebastian/exporter": "^3.0 || ^4.0 || ^5.0 || ^6.0",
28+
"sebastian/exporter": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
2929
"symfony/console": "^3.4 || ^4.4 || ^5.0 || ^6.0 || ^7.0",
3030
"symfony/event-dispatcher": "^3.4 || ^4.4 || ^5.0 || ^6.0 || ^7.0",
3131
"symfony/process": "^3.4 || ^4.4 || ^5.0 || ^6.0 || ^7.0",
@@ -38,7 +38,7 @@
3838
"require-dev": {
3939
"behat/behat": "^3.3",
4040
"symfony/filesystem": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
41-
"phpunit/phpunit": "^8.0 || ^9.0 || ^10.0 || ^11.0",
41+
"phpunit/phpunit": "^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0",
4242
"vimeo/psalm": "^4.3 || ^5.2"
4343
},
4444

integration/PhpSpec/Console/Prompter/QuestionTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
namespace integration\PhpSpec\Console\Prompter;
44

55
use PhpSpec\Console\Prompter\Question;
6+
use PHPUnit\Framework\Attributes\RequiresMethod;
7+
use PHPUnit\Framework\Attributes\Test;
68
use PHPUnit\Framework\TestCase;
9+
use Symfony\Component\Console\Helper\QuestionHelper;
710
use Symfony\Component\Console\Question\ConfirmationQuestion;
811

912
/**
1013
* @requires function \Symfony\Component\Console\Helper\QuestionHelper::ask
1114
*/
15+
#[RequiresMethod(QuestionHelper::class, 'ask')]
1216
class QuestionTest extends TestCase
1317
{
1418
/**
@@ -43,6 +47,7 @@ protected function setUp() : void
4347
/**
4448
* @test
4549
*/
50+
#[Test]
4651
function it_is_a_prompter()
4752
{
4853
$this->assertInstanceOf('PhpSpec\Console\Prompter', $this->prompter);
@@ -51,6 +56,7 @@ function it_is_a_prompter()
5156
/**
5257
* @test
5358
*/
59+
#[Test]
5460
function it_can_ask_a_question_and_return_the_result()
5561
{
5662
$this->questionHelper->expects($this->once())

integration/PhpSpec/Formatter/Presenter/Differ/ObjectEngineTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PhpSpec\Formatter\Presenter\Differ;
66

7+
use PHPUnit\Framework\Attributes\Test;
78
use PHPUnit\Framework\TestCase;
89
use SebastianBergmann\Exporter\Exporter;
910

@@ -26,24 +27,28 @@ public function setUp() : void
2627
}
2728

2829
/** @test */
30+
#[Test]
2931
public function it_is_an_differ_engine()
3032
{
3133
self::assertInstanceOf(DifferEngine::class, $this->engine);
3234
}
3335

3436
/** @test */
37+
#[Test]
3538
public function it_does_not_support_scalars()
3639
{
3740
self::assertFalse($this->engine->supports(1, 2));
3841
}
3942

4043
/** @test */
44+
#[Test]
4145
public function it_only_supports_objects()
4246
{
4347
self::assertTrue($this->engine->supports(new \StdClass(), new \StdClass()));
4448
}
4549

4650
/** @test */
51+
#[Test]
4752
public function it_converts_objects_to_string_and_diffs_the_result()
4853
{
4954
$this->stringDiffer->method('compare')

integration/PhpSpec/Loader/StreamWrapperTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use PhpSpec\Loader\StreamWrapper;
88
use PhpSpec\Loader\Transformer\InMemoryTypeHintIndex;
99
use PhpSpec\Loader\Transformer\TypeHintRewriter;
10+
use PHPUnit\Framework\Attributes\Test;
1011
use PHPUnit\Framework\TestCase;
1112

1213
class StreamWrapperTest extends TestCase
@@ -23,6 +24,7 @@ function setUp() : void
2324
* @test
2425
* @requires PHP 7.0
2526
*/
27+
#[Test]
2628
function it_loads_a_spec_with_no_typehints()
2729
{
2830
require StreamWrapper::wrapPath(__DIR__.'/examples/ExampleSpec.php');

0 commit comments

Comments
 (0)