Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TestHookObjectExtractor.php
Go to the documentation of this file.
1 <?php
8 
11 
16 {
22  private $actionObjectExtractor;
23 
27  public function __construct()
28  {
29  $this->actionObjectExtractor = new ActionObjectExtractor();
30  }
31 
42  public function extractHook($parentName, $hookType, $testHook)
43  {
44  $hookActions = $this->stripDescriptorTags(
45  $testHook,
46  self::NODE_NAME
47  );
48 
49  $hook = new TestHookObject(
50  $hookType,
51  $parentName,
52  $this->actionObjectExtractor->extractActions($hookActions)
53  );
54 
55  return $hook;
56  }
57 
64  public function createDefaultFailedHook($parentName)
65  {
66 
67  $saveScreenshotStep = [new ActionObject("saveScreenshot", "saveScreenshot", [])];
68 
69  $hook = new TestHookObject(
71  $parentName,
72  $saveScreenshotStep
73  );
74 
75  return $hook;
76  }
77 }