Code Duplication    Length = 7-7 lines in 2 locations

tests/MetadataManagerNavigationTest.php 2 locations

@@ 133-139 (lines=7) @@
130
131
        $d = $metadataManager->getEdmxXML();
132
        $CategoryEType = null;
133
        foreach (\DOMDocument::loadXML($d)->getElementsByTagName("EntityType") as $eType) {
134
            foreach ($eType->attributes as $aType) {
135
                if ($aType->name == "Name" && $aType->value == "Category") {
136
                    $CategoryEType = $eType;
137
                }
138
            }
139
        }
140
        $this->assertNotNull($CategoryEType, "Count not find the category entity Type to get the navigation property");
141
        $this->assertEquals("Products", $CategoryEType->getElementsByTagName("NavigationProperty")[0]->getAttribute("Name"), "the product relationship was not found");
142
        $ProductRelationship = $CategoryEType->getElementsByTagName("NavigationProperty")[0]->getAttribute("Relationship");
@@ 146-152 (lines=7) @@
143
        $ProductToRole = $CategoryEType->getElementsByTagName("NavigationProperty")[0]->getAttribute("ToRole");
144
        $ProductFromRole = $CategoryEType->getElementsByTagName("NavigationProperty")[0]->getAttribute("FromRole");
145
        $associationType = null;
146
        foreach (\DOMDocument::loadXML($d)->getElementsByTagName("Association") as $eType) {
147
            foreach ($eType->attributes as $aType) {
148
                if ($aType->name == "Name" && 'Data.'.$aType->value == $ProductRelationship) {
149
                    $associationType = $eType;
150
                }
151
            }
152
        }
153
        $this->assertNotNull($associationType, "count not find a matching assocation for the category");
154
        foreach ($associationType->getElementsByTagName("End") as $childNode) {
155
            if ($childNode->getAttribute("Role") == $ProductToRole) {