File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -90,3 +90,25 @@ class OtherObject
90
90
;
91
91
92
92
});
93
+
94
+ it ('test with groups Serialize class ' , function () {
95
+ $ instance = TestGroupSerialize::from (
96
+ not_construct_string:'not_construct_string ' ,
97
+ not_construct_int:'001 ' ,
98
+ type_string:'111 ' ,
99
+ type_int:99999 ,
100
+ type_object:new OtherObject (),
101
+ type_null:123 ,
102
+ type_float:998 ,
103
+ abc: 110
104
+ );
105
+
106
+ $ res = $ instance ->withGroups (['test_1 ' ])->toArray ();
107
+ expect ($ res ['not_construct_string ' ])->toBeString ('not_construct_string ' )
108
+ ->and ($ res ['type_string ' ])->toBeString ('001 ' )
109
+ ->and ($ res ['type_string_ignore ' ])->toBeString ('' )
110
+ ->and (isset ($ res ['not_construct_int ' ]))->toBeFalse ()
111
+ ->and (isset ($ res ['type_int ' ]))->toBeFalse ()
112
+ ->and (isset ($ res ['type_object ' ]))->toBeFalse ()
113
+ ->and (isset ($ res ['type_float ' ]))->toBeFalse ();
114
+ });
You can’t perform that action at this time.
0 commit comments