Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 72
[PHPUnit 10] Rename assertObjectHasAttribute() to assertObjectHasProperty(), add AssertIssetToAssertObjectHasPropertyRector#338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
29d397f00cac2ec515342f0d26e4a25c56d6557da6File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <?php | ||
| declare(strict_types=1); | ||
| use Rector\Config\RectorConfig; | ||
| use Rector\PHPUnit\PHPUnit110\Rector\Class_\NamedArgumentForDataProviderRector; | ||
| return static function (RectorConfig $rectorConfig): void { | ||
| $rectorConfig->rules([NamedArgumentForDataProviderRector::class]); | ||
| }; |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?php | ||
| namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertIssetToSpecificMethodRector\Fixture; | ||
| final class SkipProperty extends \PHPUnit\Framework\TestCase | ||
| { | ||
| public function test() | ||
| { | ||
| $this->assertTrue(isset($node->value1)); | ||
| $this->assertFalse(isset($node->value2), 'message'); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,19 @@ | ||
| <?php | ||
| namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertIssetToSpecificMethodRector\Fixture; | ||
| namespace Rector\PHPUnit\Tests\PHPUnit100\Rector\MethodCall\AssertIssetToAssertObjectHasPropertyRector\Fixture; | ||
| final class CustomIsset { | ||
| final class CustomIsset | ||
| { | ||
| public function __isset($property) { | ||
| return false; | ||
| } | ||
| } | ||
| final class SkipCustomIsset extends \PHPUnit\Framework\TestCase | ||
| final class SkipMagicIsset extends \PHPUnit\Framework\TestCase | ||
| { | ||
| public function test() | ||
| { | ||
| $foo = new CustomIsset(); | ||
| $this->assertTrue(isset($foo->bar)); | ||
| } | ||
| } | ||
| ?> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <?php | ||
| namespace Rector\PHPUnit\Tests\PHPUnit100\Rector\MethodCall\AssertIssetToAssertObjectHasPropertyRector\Fixture; | ||
| use PHPUnit\Framework\TestCase; | ||
| final class SomeIssetToProperty extends TestCase | ||
| { | ||
| public function test() | ||
| { | ||
| $object = new \stdClass(); | ||
| $this->assertTrue(isset($object->someProperty)); | ||
| } | ||
| } | ||
| ?> | ||
| ----- | ||
| <?php | ||
| namespace Rector\PHPUnit\Tests\PHPUnit100\Rector\MethodCall\AssertIssetToAssertObjectHasPropertyRector\Fixture; | ||
| use PHPUnit\Framework\TestCase; | ||
| final class SomeIssetToProperty extends TestCase | ||
| { | ||
| public function test() | ||
| { | ||
| $object = new \stdClass(); | ||
| $this->assertObjectHasAttribute('someProperty', $object); | ||
| } | ||
| } | ||
| ?> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?php | ||
| declare(strict_types=1); | ||
| use Rector\Config\RectorConfig; | ||
| use Rector\PHPUnit\PHPUnit100\Rector\MethodCall\AssertIssetToAssertObjectHasPropertyRector; | ||
| return RectorConfig::configure() | ||
| ->withRules([AssertIssetToAssertObjectHasPropertyRector::class]); |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the method seems should be
assertObjectNotHasProperty, see https://github.com/sebastianbergmann/phpunit/blob/bb24b2746512bc8be5122bb220064df8f8687451/src/Framework/Assert.php#L1052C34-L1052C60There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#340