44
55namespace SlamTest \Debug \Doctrine ;
66
7+ use ArrayIterator ;
8+ use ArrayObject ;
9+ use DateTime ;
10+ use DateTimeImmutable ;
11+ use DateTimeZone ;
712use PHPUnit \Framework \TestCase ;
813use Slam \Debug \Doctrine \Debug ;
14+ use stdClass ;
915
1016final class DebugTest extends TestCase
1117{
1218 public function testExportObject (): void
1319 {
14- $ obj = new \ stdClass ();
20+ $ obj = new stdClass ();
1521 $ obj ->foo = 'bar ' ;
1622 $ obj ->bar = 1234 ;
1723
1824 $ var = Debug::export ($ obj , 2 );
19- static ::assertEquals ('stdClass ' , $ var ->__CLASS__ );
25+ self ::assertEquals ('stdClass ' , $ var ->__CLASS__ );
2026 }
2127
2228 public function testExportObjectWithReference (): void
@@ -28,8 +34,8 @@ public function testExportObjectWithReference(): void
2834 $ var = Debug::export ($ baz , 2 );
2935 $ baz ->foo = 'tab ' ;
3036
31- static ::assertEquals ('bar ' , $ var ->foo );
32- static ::assertEquals ('tab ' , $ bar ['foo ' ]);
37+ self ::assertEquals ('bar ' , $ var ->foo );
38+ self ::assertEquals ('tab ' , $ bar ['foo ' ]);
3339 }
3440
3541 public function testExportArray (): void
@@ -38,47 +44,47 @@ public function testExportArray(): void
3844 $ var = Debug::export ($ array , 2 );
3945 $ expected = $ array ;
4046 $ expected ['b ' ]['d ' ] = 'Array(2) ' ;
41- static ::assertEquals ($ expected , $ var );
47+ self ::assertEquals ($ expected , $ var );
4248 }
4349
4450 public function testExportDateTime (): void
4551 {
46- $ obj = new \ DateTime ('2010-10-10 10:10:10 ' , new \ DateTimeZone ('UTC ' ));
52+ $ obj = new DateTime ('2010-10-10 10:10:10 ' , new DateTimeZone ('UTC ' ));
4753
4854 $ var = Debug::export ($ obj , 2 );
49- static ::assertEquals ('DateTime ' , $ var ->__CLASS__ );
50- static ::assertEquals ('2010-10-10T10:10:10+00:00 ' , $ var ->date );
55+ self ::assertEquals ('DateTime ' , $ var ->__CLASS__ );
56+ self ::assertEquals ('2010-10-10T10:10:10+00:00 ' , $ var ->date );
5157 }
5258
5359 public function testExportDateTimeImmutable (): void
5460 {
55- $ obj = new \ DateTimeImmutable ('2010-10-10 10:10:10 ' , new \ DateTimeZone ('UTC ' ));
61+ $ obj = new DateTimeImmutable ('2010-10-10 10:10:10 ' , new DateTimeZone ('UTC ' ));
5662
5763 $ var = Debug::export ($ obj , 2 );
58- static ::assertEquals ('DateTimeImmutable ' , $ var ->__CLASS__ );
59- static ::assertEquals ('2010-10-10T10:10:10+00:00 ' , $ var ->date );
64+ self ::assertEquals ('DateTimeImmutable ' , $ var ->__CLASS__ );
65+ self ::assertEquals ('2010-10-10T10:10:10+00:00 ' , $ var ->date );
6066 }
6167
6268 public function testExportDateTimeZone (): void
6369 {
64- $ obj = new \ DateTimeImmutable ('2010-10-10 12:34:56 ' , new \ DateTimeZone ('Europe/Rome ' ));
70+ $ obj = new DateTimeImmutable ('2010-10-10 12:34:56 ' , new DateTimeZone ('Europe/Rome ' ));
6571
6672 $ var = Debug::export ($ obj , 2 );
67- static ::assertEquals ('DateTimeImmutable ' , $ var ->__CLASS__ );
68- static ::assertEquals ('2010-10-10T12:34:56+02:00 ' , $ var ->date );
73+ self ::assertEquals ('DateTimeImmutable ' , $ var ->__CLASS__ );
74+ self ::assertEquals ('2010-10-10T12:34:56+02:00 ' , $ var ->date );
6975 }
7076
7177 public function testExportArrayTraversable (): void
7278 {
73- $ obj = new \ ArrayObject (['foobar ' ]);
79+ $ obj = new ArrayObject (['foobar ' ]);
7480
7581 $ var = Debug::export ($ obj , 2 );
76- static ::assertContains ('foobar ' , $ var ->__STORAGE__ );
82+ self ::assertContains ('foobar ' , $ var ->__STORAGE__ );
7783
78- $ it = new \ ArrayIterator (['foobar ' ]);
84+ $ it = new ArrayIterator (['foobar ' ]);
7985
8086 $ var = Debug::export ($ it , 5 );
81- static ::assertContains ('foobar ' , $ var ->__STORAGE__ );
87+ self ::assertContains ('foobar ' , $ var ->__STORAGE__ );
8288 }
8389
8490 public function testReturnsOutput (): void
@@ -90,7 +96,7 @@ public function testReturnsOutput(): void
9096
9197 \ob_end_clean ();
9298
93- static ::assertSame ($ outputValue , $ dump );
99+ self ::assertSame ($ outputValue , $ dump );
94100 }
95101
96102 public function testDisablesOutput (): void
@@ -102,8 +108,8 @@ public function testDisablesOutput(): void
102108
103109 \ob_end_clean ();
104110
105- static ::assertEmpty ($ outputValue );
106- static ::assertNotSame ($ outputValue , $ dump );
111+ self ::assertEmpty ($ outputValue );
112+ self ::assertNotSame ($ outputValue , $ dump );
107113 }
108114
109115 /**
@@ -117,13 +123,13 @@ public function testExportParentAttributes(TestAsset\ParentClass $class, array $
117123 $ print_r_class = \substr ($ print_r_class , (int ) \strpos ($ print_r_class , '( ' ));
118124 $ print_r_expected = \substr ($ print_r_expected , (int ) \strpos ($ print_r_expected , '( ' ));
119125
120- static ::assertSame ($ print_r_expected , $ print_r_class );
126+ self ::assertSame ($ print_r_expected , $ print_r_class );
121127
122128 $ var = Debug::export ($ class , 3 );
123129 $ var = (array ) $ var ;
124130 unset($ var ['__CLASS__ ' ]);
125131
126- static ::assertSame ($ expected , $ var );
132+ self ::assertSame ($ expected , $ var );
127133 }
128134
129135 public function provideAttributesCases ()
0 commit comments