Skip to content

[PHPUnit 8.0] Add ReplaceAssertArraySubsetWithDmsPolyfillRector#2326

Merged
TomasVotruba merged 1 commit intomasterfrom
array-subset-replace
Nov 14, 2019
Merged

[PHPUnit 8.0] Add ReplaceAssertArraySubsetWithDmsPolyfillRector#2326
TomasVotruba merged 1 commit intomasterfrom
array-subset-replace

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Nov 14, 2019

Closes #2138

Do you miss assertArraySubset method in PHPUnit 8+?

We got you covered:

composer require --dev dms/phpunit-arraysubset-asserts
vendor/bin/rector process tests --set phpunit80-dms

Instant Migration

 <?php

 use PHPUnit\Framework\TestCase;
+use DMS\PHPUnitExtensions\ArraySubset\Assert;

 final class SomeTest extends TestCase
 {
     public function testPreviouslyStaticCall(): void
     {
-        $this->assertArraySubset(['bar' => 0], ['bar' => '0'], true);
+        Assert::assertArraySubset(['bar' => 0], ['bar' => '0'], true);
     }
 }

👍

@TomasVotruba TomasVotruba merged commit fc5ea3f into master Nov 14, 2019
@TomasVotruba TomasVotruba deleted the array-subset-replace branch November 14, 2019 16:17
TomasVotruba added a commit that referenced this pull request May 18, 2022
rectorphp/rector-src@eeeba85 [Core] Improve PropertyFetchFinder to use PropertyFetchAnalyzer (#2326)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PHPUnit 8] Add rule to cope with PHPUnit deprecating assertArraySubset

1 participant