Code Duplication    Length = 24-24 lines in 2 locations

tests/WSDL/XML/XMLStyle/XMLDocumentStyleTest.php 1 location

@@ 72-95 (lines=24) @@
69
    /**
70
     * @test
71
     */
72
    public function shouldGenerateDOMElementsForMessage()
73
    {
74
        //given
75
        $nodes = [
76
            new Node('int', '$age', false),
77
            new Node('object', '$user', false, [new Node('string', '$name', false)]),
78
            new Node('string', '$numbers', true)
79
        ];
80
81
        //when
82
        $DOMElements = $this->XMLDocumentStyle->generateMessagePart($this->DOMDocument, $nodes);
83
84
        //then
85
        Assert::thatArray($DOMElements)->extracting('tagName')->containsExactly('part', 'part', 'part');
86
87
        $this->assertEquals('age', $DOMElements[0]->getAttribute('name'));
88
        $this->assertEquals('ns:age', $DOMElements[0]->getAttribute('element'));
89
90
        $this->assertEquals('user', $DOMElements[1]->getAttribute('name'));
91
        $this->assertEquals('ns:user', $DOMElements[1]->getAttribute('element'));
92
93
        $this->assertEquals('numbers', $DOMElements[2]->getAttribute('name'));
94
        $this->assertEquals('ns:numbers', $DOMElements[2]->getAttribute('element'));
95
    }
96
}
97

tests/WSDL/XML/XMLStyle/XMLRpcStyleTest.php 1 location

@@ 73-96 (lines=24) @@
70
    /**
71
     * @test
72
     */
73
    public function shouldGenerateDOMElementsForMessage()
74
    {
75
        //given
76
        $nodes = [
77
            new Node('int', '$age', false),
78
            new Node('object', '$user', false, [new Node('string', '$name', false)]),
79
            new Node('string', '$numbers', true)
80
        ];
81
82
        //when
83
        $DOMElements = $this->XMLRpcStyle->generateMessagePart($this->DOMDocument, $nodes);
84
85
        //then
86
        Assert::thatArray($DOMElements)->extracting('tagName')->containsExactly('part', 'part', 'part');
87
88
        $this->assertEquals('age', $DOMElements[0]->getAttribute('name'));
89
        $this->assertEquals('xsd:int', $DOMElements[0]->getAttribute('type'));
90
91
        $this->assertEquals('user', $DOMElements[1]->getAttribute('name'));
92
        $this->assertEquals('ns:User', $DOMElements[1]->getAttribute('element'));
93
94
        $this->assertEquals('numbers', $DOMElements[2]->getAttribute('name'));
95
        $this->assertEquals('ns:ArrayOfNumbers', $DOMElements[2]->getAttribute('type'));
96
    }
97
98
    /**
99
     * @test