19 declare(strict_types=1);
33 $logger = $this->createMock(ilLogger::class);
34 $node_info = $this->createMock(ilXMLFileNodeInfoDOMNodeHandler::class);
35 $node_info->expects($this->any())->method(
'getValueOfAttribute')->will($this->returnValueMap([
40 $node_info->expects($this->any())->method(
'hasAttribute')->will($this->returnValueMap([
46 $pair1 = $this->createMock(ilXMLFileNodeInfoAttributePair::class);
47 $pair1->expects($this->any())->method(
'getKey')->willReturn(
'key1');
48 $pair1->expects($this->any())->method(
'getValue')->willReturn(
'val1');
49 $pair2 = $this->createMock(ilXMLFileNodeInfoAttributePair::class);
50 $pair2->expects($this->any())->method(
'getKey')->willReturn(
'key2');
51 $pair2->expects($this->any())->method(
'getValue')->willReturn(
'val2');
52 $pair3 = $this->createMock(ilXMLFileNodeInfoAttributePair::class);
53 $pair3->expects($this->any())->method(
'getKey')->willReturn(
'key3');
54 $pair3->expects($this->any())->method(
'getValue')->willReturn(
'val3');
55 $pair4 = $this->createMock(ilXMLFileNodeInfoAttributePair::class);
56 $pair4->expects($this->any())->method(
'getKey')->willReturn(
'key4');
57 $pair4->expects($this->any())->method(
'getValue')->willReturn(
'val4');
59 $collection = (
new ilXMLFileNodeInfoAttributeCollection($logger))
62 ->withElement($pair3);
63 $collection2 = $collection
64 ->withElement($pair4);
66 $this->assertTrue($collection->matches($node_info));
67 $this->assertFalse($collection2->matches($node_info));
testNodeInfoAttributeCollection()