mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
[automated] Re-Generate Nodes/Rectors Documentation (#4618)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
This commit is contained in:
parent
7fcbac3230
commit
e704af3dd7
@ -10102,6 +10102,29 @@ Turns same bool and null comparisons to their method name alternatives in PHPUni
|
||||
|
||||
<br><br>
|
||||
|
||||
### `AssertSameTrueFalseToAssertTrueFalseRector`
|
||||
|
||||
- class: [`Rector\PHPUnit\Rector\MethodCall\AssertSameTrueFalseToAssertTrueFalseRector`](/rules/phpunit/src/Rector/MethodCall/AssertSameTrueFalseToAssertTrueFalseRector.php)
|
||||
- [test fixtures](/rules/phpunit/tests/Rector/MethodCall/AssertSameTrueFalseToAssertTrueFalseRector/Fixture)
|
||||
|
||||
Change `$this->assertSame(true,` ...) to `assertTrue()`
|
||||
|
||||
```diff
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class SomeTest extends TestCase
|
||||
{
|
||||
public function test()
|
||||
{
|
||||
$value = (bool) mt_rand(0, 1);
|
||||
- $this->assertSame(true, $value);
|
||||
+ $this->assertTrue($value);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br><br>
|
||||
|
||||
### `AssertTrueFalseInternalTypeToSpecificMethodRector`
|
||||
|
||||
- class: [`Rector\PHPUnit\Rector\MethodCall\AssertTrueFalseInternalTypeToSpecificMethodRector`](/rules/phpunit/src/Rector/MethodCall/AssertTrueFalseInternalTypeToSpecificMethodRector.php)
|
||||
@ -10374,33 +10397,6 @@ Remove `expect($this->any())` from mocks as it has no added value
|
||||
|
||||
<br><br>
|
||||
|
||||
### `ReplaceAssertArraySubsetRector`
|
||||
|
||||
- class: [`Rector\PHPUnit\Rector\MethodCall\ReplaceAssertArraySubsetRector`](/rules/phpunit/src/Rector/MethodCall/ReplaceAssertArraySubsetRector.php)
|
||||
- [test fixtures](/rules/phpunit/tests/Rector/MethodCall/ReplaceAssertArraySubsetRector/Fixture)
|
||||
|
||||
Replace deprecated "assertArraySubset()" method with alternative methods
|
||||
|
||||
```diff
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class SomeTest extends TestCase
|
||||
{
|
||||
public function test()
|
||||
{
|
||||
$checkedArray = [];
|
||||
|
||||
- $this->assertArraySubset([
|
||||
- 'cache_directory' => 'new_value',
|
||||
- ], $checkedArray, true);
|
||||
+ $this->assertArrayHasKey('cache_directory', $checkedArray);
|
||||
+ $this->assertSame('new_value', $checkedArray['cache_directory']);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br><br>
|
||||
|
||||
### `ReplaceAssertArraySubsetWithDmsPolyfillRector`
|
||||
|
||||
- class: [`Rector\PHPUnit\Rector\MethodCall\ReplaceAssertArraySubsetWithDmsPolyfillRector`](/rules/phpunit/src/Rector/MethodCall/ReplaceAssertArraySubsetWithDmsPolyfillRector.php)
|
||||
|
Loading…
x
Reference in New Issue
Block a user