@@ -27,8 +27,7 @@ protected function createReflectionPropertyMock(
2727 'isPublic ' ,
2828 'isProtected ' ,
2929 'isPrivate ' ,
30- 'isStatic ' ,
31- 'getValue '
30+ 'isStatic '
3231 ])
3332 ->disableOriginalConstructor ()
3433 ->getMock ();
@@ -52,13 +51,12 @@ public function testSimpleProperty()
5251 $ property ->method ('isProtected ' )->willReturn (false );
5352 $ property ->method ('isPrivate ' )->willReturn (false );
5453 $ property ->method ('isStatic ' )->willReturn (false );
55- $ property ->method ('getValue ' )->willReturn (123 );
5654
5755 /**
5856 * @var \ReflectionProperty $property
5957 */
6058 $ expectedOutput = $ t . $ t . 'public $test = 123; ' . $ n . $ n ;
61- $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property ))->format ());
59+ $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property, 123 ))->format ());
6260 }
6361
6462 public function testProtectedProperty ()
@@ -75,13 +73,12 @@ public function testProtectedProperty()
7573 $ property ->method ('isProtected ' )->willReturn (true );
7674 $ property ->method ('isPrivate ' )->willReturn (false );
7775 $ property ->method ('isStatic ' )->willReturn (false );
78- $ property ->method ('getValue ' )->willReturn (123 );
7976
8077 /**
8178 * @var \ReflectionProperty $property
8279 */
8380 $ expectedOutput = $ t . $ t . 'protected $test = 123; ' . $ n . $ n ;
84- $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property ))->format ());
81+ $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property, 123 ))->format ());
8582 }
8683
8784 public function testPrivateProperty ()
@@ -98,13 +95,12 @@ public function testPrivateProperty()
9895 $ property ->method ('isProtected ' )->willReturn (false );
9996 $ property ->method ('isPrivate ' )->willReturn (true );
10097 $ property ->method ('isStatic ' )->willReturn (false );
101- $ property ->method ('getValue ' )->willReturn (123 );
10298
10399 /**
104100 * @var \ReflectionProperty $property
105101 */
106102 $ expectedOutput = $ t . $ t . 'private $test = 123; ' . $ n . $ n ;
107- $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property ))->format ());
103+ $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property, 123 ))->format ());
108104 }
109105
110106 public function testStaticProperty ()
@@ -121,13 +117,12 @@ public function testStaticProperty()
121117 $ property ->method ('isProtected ' )->willReturn (false );
122118 $ property ->method ('isPrivate ' )->willReturn (false );
123119 $ property ->method ('isStatic ' )->willReturn (true );
124- $ property ->method ('getValue ' )->willReturn (123 );
125120
126121 /**
127122 * @var \ReflectionProperty $property
128123 */
129124 $ expectedOutput = $ t . $ t . 'public static $test = 123; ' . $ n . $ n ;
130- $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property ))->format ());
125+ $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property, 123 ))->format ());
131126 }
132127
133128 public function testIsNotDefaultProperty ()
@@ -141,13 +136,12 @@ public function testIsNotDefaultProperty()
141136 $ property ->method ('isProtected ' )->willReturn (false );
142137 $ property ->method ('isPrivate ' )->willReturn (false );
143138 $ property ->method ('isStatic ' )->willReturn (false );
144- $ property ->method ('getValue ' )->willReturn (123 );
145139
146140 /**
147141 * @var \ReflectionProperty $property
148142 */
149143 $ expectedOutput = '' ;
150- $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property ))->format ());
144+ $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property, 123 ))->format ());
151145 }
152146
153147 public function testPropertyWithoutValue ()
@@ -164,13 +158,12 @@ public function testPropertyWithoutValue()
164158 $ property ->method ('isProtected ' )->willReturn (false );
165159 $ property ->method ('isPrivate ' )->willReturn (false );
166160 $ property ->method ('isStatic ' )->willReturn (false );
167- $ property ->method ('getValue ' )->willReturn (null );
168161
169162 /**
170163 * @var \ReflectionProperty $property
171164 */
172165 $ expectedOutput = $ t . $ t . 'public $test; ' . $ n . $ n ;
173- $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property ))->format ());
166+ $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property, null ))->format ());
174167 }
175168
176169 public function testPropertyFromParent ()
@@ -184,13 +177,12 @@ public function testPropertyFromParent()
184177 $ property ->method ('isProtected ' )->willReturn (false );
185178 $ property ->method ('isPrivate ' )->willReturn (false );
186179 $ property ->method ('isStatic ' )->willReturn (false );
187- $ property ->method ('getValue ' )->willReturn (123 );
188180
189181 /**
190182 * @var \ReflectionProperty $property
191183 */
192184 $ expectedOutput = '' ;
193- $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property ))->format ());
185+ $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property, 123 ))->format ());
194186 }
195187
196188 public function testPropertyWithDoc ()
@@ -216,7 +208,6 @@ public function testPropertyWithDoc()
216208 $ property ->method ('isProtected ' )->willReturn (false );
217209 $ property ->method ('isPrivate ' )->willReturn (false );
218210 $ property ->method ('isStatic ' )->willReturn (false );
219- $ property ->method ('getValue ' )->willReturn (123 );
220211
221212 /**
222213 * @var \ReflectionProperty $property
@@ -230,6 +221,6 @@ public function testPropertyWithDoc()
230221 . $ t . $ t . ' * @var int ' . $ n
231222 . $ t . $ t . ' */ ' . $ n
232223 . $ t . $ t . 'public $test = 123; ' . $ n . $ n ;
233- $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property ))->format ());
224+ $ this ->assertSame ($ expectedOutput , (new PropertyFormatter ('TestClass ' , $ property, 123 ))->format ());
234225 }
235226}
0 commit comments