Code Duplication    Length = 7-8 lines in 2 locations

src/Xml/XmlContext.php 2 locations

@@ 71-78 (lines=8) @@
68
     *
69
     * @Then /^the XML element "(?P<element>[^"]*)" should exists?$/
70
     */
71
    public function theXmlElementShouldExist($element)
72
    {
73
        $elements = $this->xpath($element);
74
        if ($elements->length == 0) {
75
            throw new \Exception(sprintf("The element '%s' does not exist.", $element));
76
        }
77
        return $elements;
78
    }
79
80
    /**
81
     * Checks that the specified XML element does not exist
@@ 85-91 (lines=7) @@
82
     *
83
     * @Then /^the XML element "(?P<element>[^"]*)" should not exists?$/
84
     */
85
    public function theXmlElementShouldNotExist($element)
86
    {
87
        $elements = $this->xpath($element);
88
        if ($elements->length != 0) {
89
            throw new \Exception(sprintf("The element '%s' exists.", $element));
90
        }
91
    }
92
93
    /**
94
     * @Then /^the XML response should be equal to:$/