8 use \Magento\Framework\Config\Dom\ArrayNodeConfig;
24 $this->nodePathMatcher = $this->createMock(\
Magento\Framework\Config\
Dom\NodePathMatcher::class);
26 $this->nodePathMatcher,
27 [
'/root/assoc/one' =>
'name',
'/root/assoc/two' =>
'id',
'/root/assoc/three' =>
'key'],
28 [
'/root/numeric/one',
'/root/numeric/two',
'/root/numeric/three']
34 $xpath =
'/root/numeric[@attr="value"]/two';
35 $this->nodePathMatcher->expects(
43 $this->returnValue(
false)
45 $this->nodePathMatcher->expects(
53 $this->returnValue(
true)
55 $this->assertTrue($this->object->isNumericArray($xpath));
60 $xpath =
'/root/numeric[@attr="value"]/four';
61 $this->nodePathMatcher->expects(
69 $this->returnValue(
false)
71 $this->nodePathMatcher->expects(
79 $this->returnValue(
false)
81 $this->nodePathMatcher->expects(
86 '/root/numeric/three',
89 $this->returnValue(
false)
91 $this->assertFalse($this->object->isNumericArray($xpath));
96 $xpath =
'/root/assoc[@attr="value"]/two';
97 $this->nodePathMatcher->expects(
105 $this->returnValue(
false)
107 $this->nodePathMatcher->expects(
115 $this->returnValue(
true)
117 $this->assertEquals(
'id', $this->object->getAssocArrayKeyAttribute($xpath));
122 $xpath =
'/root/assoc[@attr="value"]/four';
123 $this->nodePathMatcher->expects(
131 $this->returnValue(
false)
133 $this->nodePathMatcher->expects(
141 $this->returnValue(
false)
143 $this->nodePathMatcher->expects(
151 $this->returnValue(
false)
153 $this->assertNull($this->object->getAssocArrayKeyAttribute($xpath));
testGetAssocArrayKeyAttributeMatched()
testIsNumericArrayMatched()
testIsNumericArrayNotMatched()
testGetAssocArrayKeyAttributeNotMatched()