Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions config/sets/phpunit120.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit120\Rector\CallLike\CreateStubInCoalesceArgRector;
use Rector\PHPUnit\PHPUnit120\Rector\CallLike\CreateStubOverCreateMockArgRector;
use Rector\PHPUnit\PHPUnit120\Rector\Class_\AllowMockObjectsForDataProviderRector;
use Rector\PHPUnit\PHPUnit120\Rector\Class_\AllowMockObjectsWhereParentClassRector;
use Rector\PHPUnit\PHPUnit120\Rector\Class_\AllowMockObjectsWithoutExpectationsAttributeRector;
use Rector\PHPUnit\PHPUnit120\Rector\Class_\AssertIsTypeMethodCallRector;
use Rector\PHPUnit\PHPUnit120\Rector\Class_\PropertyCreateMockToCreateStubRector;
use Rector\PHPUnit\PHPUnit120\Rector\Class_\RemoveOverrideFinalConstructTestCaseRector;
Expand All @@ -23,11 +20,5 @@
CreateStubInCoalesceArgRector::class,
ExpressionCreateMockToCreateStubRector::class,
PropertyCreateMockToCreateStubRector::class,
AllowMockObjectsWhereParentClassRector::class,
AllowMockObjectsForDataProviderRector::class,

// experimental, from PHPUnit 12.5.2
// @see https://github.com/sebastianbergmann/phpunit/commit/24c208d6a340c3071f28a9b5cce02b9377adfd43
AllowMockObjectsWithoutExpectationsAttributeRector::class,
]);
};
19 changes: 19 additions & 0 deletions config/sets/phpunit125.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit120\Rector\Class_\AllowMockObjectsForDataProviderRector;
use Rector\PHPUnit\PHPUnit120\Rector\Class_\AllowMockObjectsWhereParentClassRector;
use Rector\PHPUnit\PHPUnit120\Rector\Class_\AllowMockObjectsWithoutExpectationsAttributeRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rules([
AllowMockObjectsWhereParentClassRector::class,
AllowMockObjectsForDataProviderRector::class,

// experimental, from PHPUnit 12.5.2
// @see https://github.com/sebastianbergmann/phpunit/commit/24c208d6a340c3071f28a9b5cce02b9377adfd43
AllowMockObjectsWithoutExpectationsAttributeRector::class,
]);
};
1 change: 1 addition & 0 deletions src/Enum/PHPUnitAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ final class PHPUnitAttribute
public const string TEST = 'PHPUnit\Framework\Attributes\Test';

/**
* Since PHPUnit 12.5.2
* @see https://github.com/sebastianbergmann/phpunit/commit/24c208d6a340c3071f28a9b5cce02b9377adfd43
*/
public const string ALLOW_MOCK_OBJECTS_WITHOUT_EXPECTATIONS = 'PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations';
Expand Down
6 changes: 6 additions & 0 deletions src/Set/SetProvider/PHPUnitSetProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public function provide(): array
'12.0',
__DIR__ . '/../../../config/sets/phpunit120.php'
),
new ComposerTriggeredSet(
SetGroup::PHPUNIT,
'phpunit/phpunit',
'12.5',
__DIR__ . '/../../../config/sets/phpunit125.php'
),

new Set(SetGroup::PHPUNIT, 'Code Quality', __DIR__ . '/../../../config/sets/phpunit-code-quality.php'),

Expand Down