Code Duplication    Length = 12-12 lines in 3 locations

src/Oro/Bundle/ContactBundle/Tests/Selenium/Pages/Contact.php 2 locations

@@ 87-98 (lines=12) @@
84
        return $this->email->value();
85
    }
86
87
    public function setAddressTypes($values, $addressId = 0)
88
    {
89
        $xpath = "//input[@name = 'oro_contact_form[addresses][{$addressId}][types][]'";
90
        if ($this->isElementPresent("//div[@role='dialog']")) {
91
            $xpath = "//input[@name='oro_contact_address_form[types][]'";
92
        }
93
        foreach ($values as $type) {
94
            $this->test->byXpath("{$xpath} and @value = '{$type}']")->click();
95
        }
96
97
        return $this;
98
    }
99
100
    public function setAddressPrimary($value, $addressId = 0)
101
    {
@@ 100-111 (lines=12) @@
97
        return $this;
98
    }
99
100
    public function setAddressPrimary($value, $addressId = 0)
101
    {
102
        $primary = "//input[@data-ftid='oro_contact_form_addresses_{$addressId}_primary']";
103
        if ($this->isElementPresent("//div[@role='dialog']")) {
104
            $primary = ("//input[@data-ftid='oro_contact_address_form_primary']");
105
        }
106
        if ($value) {
107
            $this->test->byXpath($primary)->click();
108
        }
109
110
        return $this;
111
    }
112
113
    public function getAddressTypes($addressId)
114
    {

src/Oro/Bundle/SalesBundle/Tests/Selenium/Pages/Lead.php 1 location

@@ 217-228 (lines=12) @@
214
        return $this;
215
    }
216
217
    public function setAddressPrimary($value, $addressId = 0)
218
    {
219
        $primary = "//input[@data-ftid='oro_sales_lead_form_addresses_{$addressId}_primary']";
220
        if ($this->isElementPresent("//div[@role='dialog']")) {
221
            $primary = ("//input[@data-ftid='oro_sales_lead_address_form_primary']");
222
        }
223
        if ($value) {
224
            $this->test->byXpath($primary)->click();
225
        }
226
227
        return $this;
228
    }
229
230
    public function getAddressPrimary($addressId = 0)
231
    {