1111
1212namespace CodeIgniter \Test ;
1313
14+ use Tests \Support \Test \TestForReflectionHelper ;
15+
1416/**
1517 * @internal
1618 *
@@ -20,30 +22,30 @@ final class ReflectionHelperTest extends CIUnitTestCase
2022{
2123 public function testGetPrivatePropertyWithObject (): void
2224 {
23- $ obj = new __TestForReflectionHelper ();
25+ $ obj = new TestForReflectionHelper ();
2426 $ actual = $ this ->getPrivateProperty ($ obj , 'private ' );
2527 $ this ->assertSame ('secret ' , $ actual );
2628 }
2729
2830 public function testGetPrivatePropertyWithObjectStaticCall (): void
2931 {
30- $ obj = new __TestForReflectionHelper ();
32+ $ obj = new TestForReflectionHelper ();
3133 $ actual = CIUnitTestCase::getPrivateProperty ($ obj , 'private ' );
3234 $ this ->assertSame ('secret ' , $ actual );
3335 }
3436
3537 public function testGetPrivatePropertyWithStatic (): void
3638 {
3739 $ actual = $ this ->getPrivateProperty (
38- __TestForReflectionHelper ::class,
40+ TestForReflectionHelper ::class,
3941 'static_private '
4042 );
4143 $ this ->assertSame ('xyz ' , $ actual );
4244 }
4345
4446 public function testSetPrivatePropertyWithObject (): void
4547 {
46- $ obj = new __TestForReflectionHelper ();
48+ $ obj = new TestForReflectionHelper ();
4749 $ this ->setPrivateProperty (
4850 $ obj ,
4951 'private ' ,
@@ -55,19 +57,19 @@ public function testSetPrivatePropertyWithObject(): void
5557 public function testSetPrivatePropertyWithStatic (): void
5658 {
5759 $ this ->setPrivateProperty (
58- __TestForReflectionHelper ::class,
60+ TestForReflectionHelper ::class,
5961 'static_private ' ,
6062 'abc '
6163 );
6264 $ this ->assertSame (
6365 'abc ' ,
64- __TestForReflectionHelper ::getStaticPrivate ()
66+ TestForReflectionHelper ::getStaticPrivate ()
6567 );
6668 }
6769
6870 public function testGetPrivateMethodInvokerWithObject (): void
6971 {
70- $ obj = new __TestForReflectionHelper ();
72+ $ obj = new TestForReflectionHelper ();
7173 $ method = $ this ->getPrivateMethodInvoker (
7274 $ obj ,
7375 'privateMethod '
@@ -81,7 +83,7 @@ public function testGetPrivateMethodInvokerWithObject(): void
8183 public function testGetPrivateMethodInvokerWithStatic (): void
8284 {
8385 $ method = $ this ->getPrivateMethodInvoker (
84- __TestForReflectionHelper ::class,
86+ TestForReflectionHelper ::class,
8587 'privateStaticMethod '
8688 );
8789 $ this ->assertSame (
@@ -90,29 +92,3 @@ public function testGetPrivateMethodInvokerWithStatic(): void
9092 );
9193 }
9294}
93-
94- class __TestForReflectionHelper
95- {
96- private string $ private = 'secret ' ;
97- private static string $ static_private = 'xyz ' ;
98-
99- public function getPrivate ()
100- {
101- return $ this ->private ;
102- }
103-
104- public static function getStaticPrivate ()
105- {
106- return self ::$ static_private ;
107- }
108-
109- private function privateMethod ($ param1 , $ param2 )
110- {
111- return 'private ' . $ param1 . $ param2 ;
112- }
113-
114- private static function privateStaticMethod ($ param1 , $ param2 )
115- {
116- return 'private_static ' . $ param1 . $ param2 ;
117- }
118- }
0 commit comments