@@ -19,6 +19,7 @@ public function testJson()
1919 ->column ('parent_id ' )->references ('nodes ' )->null ()->jsonSerialize ()->include ()
2020 ->column ('root_id ' )->references ('nodes ' )->null ()->jsonSerialize ()->ignore ()
2121 ->column ('owner_id ' )->references ('nodes ' )->null ()->jsonSerialize ()->formatUsingProperty ('name ' )->include ()
22+ ->column ('owner_country ' )->references ('nodes ' )->null ()->jsonSerialize ()->formatUsingMethod ('myMethod ' )->include ()
2223 ->column ('name ' )->string ()->jsonSerialize ()->key ('basename ' )
2324 ->column ('size ' )->integer ()->notNull ()->default (0 )->jsonSerialize ()->numericFormat (null , null , null , ' o ' )
2425 ->column ('weight ' )->float ()->null ()->jsonSerialize ()->numericFormat (2 , ', ' , '. ' , 'g ' )
@@ -31,10 +32,14 @@ public function testJson()
3132 $ this ->assertContains ("@JsonInclude " , $ nodesTable ->getColumn ('parent_id ' )->getComment ());
3233 $ this ->assertContains ("@JsonIgnore " , $ nodesTable ->getColumn ('root_id ' )->getComment ());
3334 $ this ->assertContains ('@JsonFormat(property = "name") ' , $ nodesTable ->getColumn ('owner_id ' )->getComment ());
35+ $ this ->assertContains ('@JsonFormat(method = "myMethod") ' , $ nodesTable ->getColumn ('owner_country ' )->getComment ());
3436 $ this ->assertContains ("@JsonKey(key = \"basename \") " , $ nodesTable ->getColumn ('name ' )->getComment ());
3537 $ this ->assertContains ("@JsonFormat(unit = \" o \") " , $ nodesTable ->getColumn ('size ' )->getComment ());
3638 $ this ->assertContains ("@JsonFormat(decimals = 2, point = \", \", separator = \". \", unit = \"g \") " , $ nodesTable ->getColumn ('weight ' )->getComment ());
3739 $ this ->assertContains ("@JsonFormat(date = \"Y-m-d \") " , $ nodesTable ->getColumn ('created_at ' )->getComment ());
3840 $ this ->assertContains ("@JsonCollection( \"entries \") " , $ nodesTable ->getColumn ('another_parent ' )->getComment ());
41+
42+ $ anotherColumn = $ fluid ->table ('nodes ' )->column ('another_column ' )->integer ();
43+ $ this ->assertSame ($ anotherColumn , $ anotherColumn ->jsonSerialize ()->endJsonSerialize ());
3944 }
4045}
0 commit comments