This repository was archived by the owner on Oct 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 2424 * @method StateDraft setInitial(bool $initial = null)
2525 * @method StateReferenceCollection getTransitions()
2626 * @method StateDraft setTransitions(StateReferenceCollection $transitions = null)
27+ * @method array getRoles()
28+ * @method StateDraft setRoles(array $roles = null)
2729 */
2830class StateDraft extends JsonObject
2931{
@@ -37,6 +39,7 @@ public function fieldDefinitions()
3739 'name ' => [static ::TYPE => '\Commercetools\Core\Model\Common\LocalizedString ' ],
3840 'description ' => [static ::TYPE => '\Commercetools\Core\Model\Common\LocalizedString ' ],
3941 'initial ' => [static ::TYPE => 'bool ' ],
42+ 'roles ' => [static ::TYPE => 'array ' ],
4043 'transitions ' => [static ::TYPE => '\Commercetools\Core\Model\State\StateReferenceCollection ' ]
4144 ];
4245 }
Original file line number Diff line number Diff line change @@ -810,6 +810,7 @@ stateDraft:
810810 - description
811811 - initial
812812 - transitions
813+ - roles
813814
814815location :
815816 domain : zone
Original file line number Diff line number Diff line change @@ -253,6 +253,16 @@ public function testSetRoles()
253253 $ this ->assertInstanceOf ('\Commercetools\Core\Model\State\State ' , $ result );
254254 }
255255
256+ public function testCreateWithRoles ()
257+ {
258+ $ draft = $ this ->getDraft ('set-roles ' );
259+ $ draft ->setRoles (['ReviewIncludedInStatistics ' ]);
260+ $ state = $ this ->createState ($ draft );
261+
262+ $ this ->assertInstanceOf ('\Commercetools\Core\Model\State\State ' , $ state );
263+ $ this ->assertSame (['ReviewIncludedInStatistics ' ], $ state ->getRoles ());
264+ }
265+
256266 public function testAddRemoveRoles ()
257267 {
258268 $ draft = $ this ->getDraft ('add-roles ' );
You can’t perform that action at this time.
0 commit comments