Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ActionGroupObjectBuilder.php
Go to the documentation of this file.
1 <?php
7 namespace tests\unit\Util;
8 
11 
13 {
14  const DEFAULT_ACTION_OBJECT_NAME = 'action1';
15 
21  private $name = "testActionGroupObject";
22 
28  private $actionObjects = [];
29 
35  private $arguments = [];
36 
42  private $extends = null;
43 
50  public function withName($name)
51  {
52  $this->name = $name;
53  return $this;
54  }
55 
62  public function withArguments($args)
63  {
64  $this->arguments = $args;
65  return $this;
66  }
67 
74  public function withActionObjects($actionObjs)
75  {
76  $this->actionObjects = $actionObjs;
77  return $this;
78  }
79 
86  public function withExtendedAction($extendedActionGroup)
87  {
88  $this->extends = $extendedActionGroup;
89  return $this;
90  }
91 
95  public function __construct()
96  {
97  $this->actionObjects = [
98  new ActionObject(self::DEFAULT_ACTION_OBJECT_NAME, 'testAction', ['userInput' => 'literal'])
99  ];
100  }
101 
107  public function build()
108  {
109  return new ActionGroupObject(
110  $this->name,
111  $this->arguments,
112  $this->actionObjects,
113  $this->extends
114  );
115  }
116 }