forked from magento/magento2-functional-testing-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaseObjectExtractor.php
43 lines (38 loc) · 929 Bytes
/
BaseObjectExtractor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\FunctionalTestingFramework\Test\Util;
/**
* Class BaseObjectExtractor
*/
class BaseObjectExtractor
{
const NODE_NAME = 'nodeName';
const NAME = 'name';
const OBJ_DEPRECATED = 'deprecated';
/**
* BaseObjectExtractor constructor.
*/
public function __construct()
{
// empty
}
/**
* This method takes an array of data and an array representing irrelevant tags. The method strips
* the data passed in of the irrelevant tags and returns the result.
*
* @param array $data
* @param array ...$tags
* @return array
*/
protected function stripDescriptorTags($data, ...$tags)
{
$results = $data;
foreach ($tags as $tag) {
unset($results[$tag]);
}
return $results;
}
}