@@ -33,9 +33,7 @@ public function testAddProperty(string $sourceFilename, $propertyName, array $co
33
33
$ expectedSource = file_get_contents (__DIR__ .'/fixtures/add_property/ ' .$ expectedSourceFilename );
34
34
35
35
$ manipulator = new ClassSourceManipulator ($ source );
36
- $ method = (new \ReflectionObject ($ manipulator ))->getMethod ('addProperty ' );
37
- $ method ->setAccessible (true );
38
- $ method ->invoke ($ manipulator , name: $ propertyName , comments: $ commentLines );
36
+ $ manipulator ->addProperty (name: $ propertyName , comments: $ commentLines );
39
37
40
38
$ this ->assertSame ($ expectedSource , $ manipulator ->getSourceCode ());
41
39
}
@@ -83,9 +81,7 @@ public function testAddGetter(string $sourceFilename, string $propertyName, stri
83
81
$ expectedSource = file_get_contents (__DIR__ .'/fixtures/add_getter/ ' .$ expectedSourceFilename );
84
82
85
83
$ manipulator = new ClassSourceManipulator ($ source );
86
- $ method = (new \ReflectionObject ($ manipulator ))->getMethod ('addGetter ' );
87
- $ method ->setAccessible (true );
88
- $ method ->invoke ($ manipulator , $ propertyName , $ type , true , $ commentLines );
84
+ $ manipulator ->addGetter ($ propertyName , $ type , true , $ commentLines );
89
85
90
86
$ this ->assertSame ($ expectedSource , $ manipulator ->getSourceCode ());
91
87
}
@@ -137,9 +133,7 @@ public function testAddSetter(string $sourceFilename, string $propertyName, stri
137
133
$ expectedSource = file_get_contents (__DIR__ .'/fixtures/add_setter/ ' .$ expectedSourceFilename );
138
134
139
135
$ manipulator = new ClassSourceManipulator ($ source );
140
- $ method = (new \ReflectionObject ($ manipulator ))->getMethod ('addSetter ' );
141
- $ method ->setAccessible (true );
142
- $ method ->invoke ($ manipulator , $ propertyName , $ type , $ isNullable , $ commentLines );
136
+ $ manipulator ->addSetter ($ propertyName , $ type , $ isNullable , $ commentLines );
143
137
144
138
$ this ->assertSame ($ expectedSource , $ manipulator ->getSourceCode ());
145
139
}
@@ -624,25 +618,6 @@ public function getAddOneToOneRelationTests(): \Generator
624
618
];
625
619
}
626
620
627
- public function testGenerationWithTabs (): void
628
- {
629
- $ this ->markTestIncomplete ('We need to refactor the invoked addProperty method to pass an attribute node instead of an annotation array ' );
630
- $ source = file_get_contents (__DIR__ .'/fixtures/source/ProductWithTabs.php ' );
631
- $ expectedSource = file_get_contents (__DIR__ .'/fixtures/with_tabs/ProductWithTabs.php ' );
632
-
633
- $ manipulator = new ClassSourceManipulator ($ source );
634
-
635
- $ method = (new \ReflectionObject ($ manipulator ))->getMethod ('addProperty ' );
636
- $ method ->setAccessible (true );
637
- $ method ->invoke ($ manipulator , 'name ' , ['@ORM\Column(type="string", length=255) ' ]);
638
-
639
- $ method = (new \ReflectionObject ($ manipulator ))->getMethod ('addGetter ' );
640
- $ method ->setAccessible (true );
641
- $ method ->invoke ($ manipulator , 'id ' , 'int ' , false );
642
-
643
- $ this ->assertSame ($ expectedSource , $ manipulator ->getSourceCode ());
644
- }
645
-
646
621
public function testAddInterface (): void
647
622
{
648
623
$ source = file_get_contents (__DIR__ .'/fixtures/source/User_simple.php ' );
0 commit comments