@@ -27,19 +27,27 @@ public function testJson()
2727 ->column ('another_parent ' )->references ('nodes ' )->comment ('@JsonCollection("entries") @JsonFormat(property="entry") ' );
2828
2929 $ nodesTable = $ schema ->getTable ('nodes ' );
30- $ this ->assertContains (" @JsonIgnore " , $ nodesTable ->getColumn ('id ' )->getComment ());
31- $ this ->assertContains (" @JsonRecursive " , $ nodesTable ->getColumn ('alias_id ' )->getComment ());
32- $ this ->assertContains (" @JsonInclude " , $ nodesTable ->getColumn ('parent_id ' )->getComment ());
33- $ this ->assertContains (" @JsonIgnore " , $ nodesTable ->getColumn ('root_id ' )->getComment ());
30+ $ this ->assertContains (' @JsonIgnore ' , $ nodesTable ->getColumn ('id ' )->getComment ());
31+ $ this ->assertContains (' @JsonRecursive ' , $ nodesTable ->getColumn ('alias_id ' )->getComment ());
32+ $ this ->assertContains (' @JsonInclude ' , $ nodesTable ->getColumn ('parent_id ' )->getComment ());
33+ $ this ->assertContains (' @JsonIgnore ' , $ nodesTable ->getColumn ('root_id ' )->getComment ());
3434 $ this ->assertContains ('@JsonFormat(property = "name") ' , $ nodesTable ->getColumn ('owner_id ' )->getComment ());
3535 $ this ->assertContains ('@JsonFormat(method = "myMethod") ' , $ nodesTable ->getColumn ('owner_country ' )->getComment ());
36- $ this ->assertContains ("@JsonKey(key = \"basename \") " , $ nodesTable ->getColumn ('name ' )->getComment ());
37- $ this ->assertContains ("@JsonFormat(unit = \" o \") " , $ nodesTable ->getColumn ('size ' )->getComment ());
38- $ this ->assertContains ("@JsonFormat(decimals = 2, point = \", \", separator = \". \", unit = \"g \") " , $ nodesTable ->getColumn ('weight ' )->getComment ());
39- $ this ->assertContains ("@JsonFormat(date = \"Y-m-d \") " , $ nodesTable ->getColumn ('created_at ' )->getComment ());
40- $ this ->assertContains ("@JsonCollection( \"entries \") " , $ nodesTable ->getColumn ('another_parent ' )->getComment ());
36+ $ this ->assertContains ('@JsonKey(key = "basename") ' , $ nodesTable ->getColumn ('name ' )->getComment ());
37+ $ this ->assertContains ('@JsonFormat(unit = " o") ' , $ nodesTable ->getColumn ('size ' )->getComment ());
38+ $ this ->assertContains ('@JsonFormat(decimals = 2, point = ",", separator = ".", unit = "g") ' , $ nodesTable ->getColumn ('weight ' )->getComment ());
39+ $ this ->assertContains ('@JsonFormat(date = "Y-m-d") ' , $ nodesTable ->getColumn ('created_at ' )->getComment ());
40+ $ this ->assertContains ('@JsonCollection("entries") ' , $ nodesTable ->getColumn ('another_parent ' )->getComment ());
41+
42+ $ fluid ->table ('node_entries ' )
43+ ->column ('id ' )->integer ()->primaryKey ()->autoIncrement ()
44+ ->column ('node_id ' )->references ('nodes ' )->jsonSerialize ()->collection ("entries " )
45+ ->column ('entry ' )->string ()->null ();
46+
47+ $ this ->assertContains ('@JsonCollection(key = "entries") ' , $ schema ->getTable ('node_entries ' )->getColumn ('node_id ' )->getComment ());
4148
4249 $ anotherColumn = $ fluid ->table ('nodes ' )->column ('another_column ' )->integer ();
4350 $ this ->assertSame ($ anotherColumn , $ anotherColumn ->jsonSerialize ()->endJsonSerialize ());
51+ $ this ->assertSame ($ fluid ->table ('nodes ' ), $ anotherColumn ->jsonSerialize ()->then ());
4452 }
4553}
0 commit comments