forked from PHP-CS-Fixer/PHP-CS-Fixer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHP-CS-Fixer#7968 added new ruleset, fixed tests
- Loading branch information
1 parent
2c8ca76
commit 0193955
Showing
17 changed files
with
233 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
====================================== | ||
Rule set ``@PHPUnit91Migration:risky`` | ||
====================================== | ||
|
||
Rules to improve tests code for PHPUnit 9.1 compatibility. | ||
|
||
Warning | ||
------- | ||
|
||
This set contains rules that are risky | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Using this rule set may lead to changes in your code's logic and behaviour. Use it with caution and review changes before incorporating them into your code base. | ||
|
||
Rules | ||
----- | ||
|
||
- `@PHPUnit84Migration:risky <./PHPUnit84MigrationRisky.rst>`_ | ||
- `php_unit_dedicate_assert <./../rules/php_unit/php_unit_dedicate_assert.rst>`_ with config: | ||
|
||
``['target' => '9.1']`` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of PHP CS Fixer. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* Dariusz Rumiński <dariusz.ruminski@gmail.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace PhpCsFixer\RuleSet\Sets; | ||
|
||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; | ||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class PHPUnit91MigrationRiskySet extends AbstractMigrationSetDescription | ||
{ | ||
public function getRules(): array | ||
{ | ||
return [ | ||
'@PHPUnit84Migration:risky' => true, | ||
'php_unit_dedicate_assert' => [ | ||
'target' => PhpUnitTargetVersion::VERSION_9_1, | ||
], | ||
]; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/Fixtures/Integration/set/@PHPUnit91Migration-risky.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--TEST-- | ||
Integration of @PHPUnit91Migration:risky. | ||
--RULESET-- | ||
{"@PHPUnit91Migration:risky": true} |
19 changes: 19 additions & 0 deletions
19
tests/Fixtures/Integration/set/@PHPUnit91Migration-risky.test-in.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
use PHPUnit_Framework_Assert; | ||
use PHPUnit_Framework_BaseTestListener; | ||
use PHPUnit_Framework_TestListener; | ||
use PHPUnit_Aaa; | ||
use PHPUnit_Aaa_Bbb; | ||
use PHPUnit_Aaa_Bbb_Ccc; | ||
use PHPUnit_Aaa_Bbb_Ccc_Ddd; | ||
use PHPUnit_Aaa_Bbb_Ccc_Ddd_Eee; | ||
|
||
class FooTest extends \PHPUnit_Framework_TestCase { | ||
public function test_dedicate_assert($foo) { | ||
$this->assertFalse(is_dir($foo)); | ||
$this->assertFalse(is_writable($foo)); | ||
$this->assertFalse(file_exists($foo)); | ||
$this->assertFalse(is_readable($foo)); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/Fixtures/Integration/set/@PHPUnit91Migration-risky.test-out.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
use PHPUnit\Framework\Assert; | ||
use PHPUnit\Framework\BaseTestListener; | ||
use PHPUnit\Framework\TestListener; | ||
use PHPUnit\Aaa; | ||
use PHPUnit\Aaa\Bbb; | ||
use PHPUnit\Aaa\Bbb\Ccc; | ||
use PHPUnit\Aaa\Bbb\Ccc\Ddd; | ||
use PHPUnit\Aaa\Bbb\Ccc\Ddd\Eee; | ||
|
||
class FooTest extends \PHPUnit\Framework\TestCase { | ||
public function test_dedicate_assert($foo) { | ||
$this->assertDirectoryDoesNotExist($foo); | ||
$this->assertIsNotWritable($foo); | ||
$this->assertFileDoesNotExist($foo); | ||
$this->assertIsNotReadable($foo); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.