File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,11 @@ public function __debugInfo(): array
168
168
if ($ property ->isPrivate ()) {
169
169
$ propertyName .= ':private ' ;
170
170
}
171
- $ result [$ propertyName ] = $ property ->getValue ($ this );
171
+ $ propertyValue = $ property ->getValue ($ this );
172
+ if ($ propertyValue instanceof \Ramsey \Uuid \UuidInterface) {
173
+ $ propertyValue = $ propertyValue ->toString () . " (UUIDv {$ propertyValue ->getVersion ()}) " ;
174
+ }
175
+ $ result [$ propertyName ] = $ propertyValue ;
172
176
}
173
177
return $ result ;
174
178
}
Original file line number Diff line number Diff line change 8
8
use Composite \Entity \Tests \TestStand \TestEntityWithHydrator ;
9
9
use Composite \Entity \Tests \TestStand \TestSubEntity ;
10
10
use PHPUnit \Framework \Attributes \DataProvider ;
11
+ use Ramsey \Uuid \Uuid ;
12
+ use Ramsey \Uuid \UuidInterface ;
11
13
12
14
final class AbstractEntityTest extends \PHPUnit \Framework \TestCase
13
15
{
@@ -223,16 +225,19 @@ public function __construct(
223
225
public function test_debugInfo (): void
224
226
{
225
227
$ entity = new class extends AbstractEntity {
228
+ public UuidInterface $ uuid ;
226
229
public int $ var1 = 1 ;
227
230
protected int $ var2 = 2 ;
228
231
private int $ var3 = 3 ;
229
232
public int $ var4 ;
230
233
public function __construct (
231
234
public TestSubEntity $ subEntity = new TestSubEntity (),
232
235
) {
236
+ $ this ->uuid = Uuid::fromString ('123e4567-e89b-12d3-a456-426655440000 ' );
233
237
}
234
238
};
235
239
$ expected = print_r ([
240
+ 'uuid ' => '123e4567-e89b-12d3-a456-426655440000 (UUIDv1) ' ,
236
241
'var1 ' => 1 ,
237
242
'var2 ' => 2 ,
238
243
'var3:private ' => 3 ,
You can’t perform that action at this time.
0 commit comments