Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ActionGroupObjectExtractorTest.php
Go to the documentation of this file.
1 <?php
7 
11 
13 {
15  private $testActionGroupObjectExtractor;
16 
20  public function setUp()
21  {
22  $this->testActionGroupObjectExtractor = new ActionGroupObjectExtractor();
23  TestLoggingUtil::getInstance()->setMockLoggingUtil();
24  }
25 
29  public function testEmptyStepKey()
30  {
31  $this->expectExceptionMessage(
32  "StepKeys cannot be empty. Action='sampleAction' in Action Group filename.xml"
33  );
34  $this->testActionGroupObjectExtractor->extractActionGroup($this->createBasicActionObjectArray(""));
35  }
36 
45  private function createBasicActionObjectArray(
46  $stepKey = 'testAction1',
47  $actionGroup = "actionGroup",
48  $filename = "filename.xml"
49  ) {
50  $baseArray = [
51  'nodeName' => 'actionGroup',
52  'name' => $actionGroup,
53  'filename' => $filename,
54  $stepKey => [
55  "nodeName" => "sampleAction",
56  "stepKey" => $stepKey,
57  "someAttribute" => "someAttributeValue"
58  ]
59  ];
60  return $baseArray;
61  }
62 
66  public static function tearDownAfterClass()
67  {
68  TestLoggingUtil::getInstance()->clearMockLoggingUtil();
69  }
70 }