File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -137,9 +137,6 @@ public function __debugInfo(): array
137
137
{
138
138
$ result = [];
139
139
foreach ((new \ReflectionClass ($ this ))->getProperties () as $ property ) {
140
- if ($ property ->name === '_initialColumns ' ) {
141
- continue ;
142
- }
143
140
if (!$ property ->isInitialized ($ this )) {
144
141
continue ;
145
142
}
Original file line number Diff line number Diff line change 4
4
5
5
use Composite \Entity \AbstractEntity ;
6
6
use Composite \Entity \Helpers \DateTimeHelper ;
7
+ use Composite \Entity \Tests \TestStand \TestSubEntity ;
7
8
8
9
final class AbstractEntityTest extends \PHPUnit \Framework \TestCase
9
10
{
@@ -219,4 +220,27 @@ public function __construct(
219
220
$ loadedEntity = $ entity ::fromArray ($ dataArray );
220
221
$ this ->assertEquals ($ dataArray , $ loadedEntity ->toArray ());
221
222
}
223
+
224
+ public function test_debugInfo (): void
225
+ {
226
+ $ entity = new class extends AbstractEntity {
227
+ public int $ var1 = 1 ;
228
+ protected int $ var2 = 2 ;
229
+ private int $ var3 = 3 ;
230
+ public int $ var4 ;
231
+ public function __construct (
232
+ public TestSubEntity $ subEntity = new TestSubEntity (),
233
+ ) {
234
+ }
235
+ };
236
+ $ expected = print_r ([
237
+ 'var1 ' => 1 ,
238
+ 'var2 ' => 2 ,
239
+ 'var3:private ' => 3 ,
240
+ 'subEntity ' => new TestSubEntity (),
241
+ ], true );
242
+
243
+ $ expected = str_replace ('Array ' , 'Composite\Entity\AbstractEntity@anonymous Object ' , $ expected );
244
+ $ this ->assertEquals ($ expected , print_r ($ entity , true ));
245
+ }
222
246
}
You can’t perform that action at this time.
0 commit comments