Skip to content

Commit 1f2a3a4

Browse files
committed
JSON Serialize Stop Recursion: Add test
1 parent 5621827 commit 1f2a3a4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/TDBMDaoGeneratorTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,4 +2140,13 @@ public function testOneToOneInverseRelationGetter(): void
21402140
$this->assertSame($objectInherited, $objectBase->getInheritedObject());
21412141
$this->assertEquals(1, $objectBase->jsonSerialize()['inheritedObject']['id']);
21422142
}
2143+
2144+
public function testLazyStopRecursion(): void
2145+
{
2146+
$albumDao = new AlbumDao($this->tdbmService);
2147+
$albumBean = $albumDao->getById(1);
2148+
$json = $albumBean->jsonSerialize(true);
2149+
$this->assertArrayHasKey('id', $json['artist']);
2150+
$this->assertArrayNotHasKey('name', $json['artist']);
2151+
}
21432152
}

0 commit comments

Comments
 (0)