File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
rules-tests/PHPUnit100/Rector/MethodCall/PropertyExistsWithoutAssertRector/Fixture
rules/PHPUnit100/Rector/MethodCall Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \PHPUnit \Tests \PHPUnit100 \Rector \MethodCall \PropertyExistsWithoutAssertRector \Fixture ;
4+
5+ use PHPUnit \Framework \TestCase ;
6+
7+ final class AssertObjectHasAttribute extends TestCase
8+ {
9+ public function test (object $ someObject )
10+ {
11+ $ this ->assertObjectHasAttribute ('property ' , $ someObject );
12+ }
13+ }
14+
15+ ?>
16+ -----
17+ <?php
18+
19+ namespace Rector \PHPUnit \Tests \PHPUnit100 \Rector \MethodCall \PropertyExistsWithoutAssertRector \Fixture ;
20+
21+ use PHPUnit \Framework \TestCase ;
22+
23+ final class AssertObjectHasAttribute extends TestCase
24+ {
25+ public function test (object $ someObject )
26+ {
27+ $ this ->assertTrue (property_exists ($ someObject , 'property ' ));
28+ }
29+ }
30+
31+ ?>
Original file line number Diff line number Diff line change @@ -28,10 +28,16 @@ final class PropertyExistsWithoutAssertRector extends AbstractRector
2828 */
2929 private const RENAME_METHODS_WITH_OBJECT_MAP = [
3030 'assertClassHasAttribute ' => 'assertTrue ' ,
31+ 'assertObjectHasAttribute ' => 'assertTrue ' ,
3132 'assertClassHasStaticAttribute ' => 'assertTrue ' ,
32- ' classHasStaticAttribute ' => ' assertTrue ' ,
33+ // false
3334 'assertClassNotHasStaticAttribute ' => 'assertFalse ' ,
3435 'assertClassNotHasAttribute ' => 'assertFalse ' ,
36+ 'assertObjectNotHasAttribute ' => 'assertFalse ' ,
37+ // no assert
38+ 'objectHasAttribute ' => 'assertTrue ' ,
39+ 'classHasAttribute ' => 'assertTrue ' ,
40+ 'classHasStaticAttribute ' => 'assertTrue ' ,
3541 ];
3642
3743 public function __construct (
You can’t perform that action at this time.
0 commit comments