Code Duplication    Length = 14-15 lines in 2 locations

src/OroCRM/Bundle/ContactBundle/Tests/Behat/Context/FeatureContext.php 1 location

@@ 54-68 (lines=15) @@
51
     *
52
     * @Given /^click edit (?P<address>[^"]+) address$/
53
     */
54
    public function clickEditAddress($address)
55
    {
56
        $addresses = $this->getSession()->getPage()->findAll('css', 'div.map-address-list .map-item');
57
58
        /** @var NodeElement $actualAddress */
59
        foreach ($addresses as $actualAddress) {
60
            if (false !== strpos($actualAddress->getText(), $address)) {
61
                $actualAddress->find('css', '.item-edit-button')->click();
62
63
                return;
64
            }
65
        }
66
67
        self::fail(sprintf('Address "%s" not found', $address));
68
    }
69
70
    /**
71
     * Delete address form entity view page by clicking on trash icon given address

src/OroCRM/Bundle/AccountBundle/Tests/Behat/Context/FeatureContext.php 1 location

@@ 50-63 (lines=14) @@
47
    /**
48
     * @When :name should be default contact
49
     */
50
    public function assertDefaultContact($name)
51
    {
52
        $contactBoxes = $this->getSession()->getPage()->findAll('css', '.contact-box');
53
54
        /** @var NodeElement $box */
55
        foreach ($contactBoxes as $box) {
56
            if (false !== strpos($box->getText(), $name)) {
57
                self::assertRegExp('/Default Contact/i', $box->getText());
58
                return;
59
            }
60
        }
61
62
        self::fail(sprintf('Can\'t find contact with "%s" name', $name));
63
    }
64
65
66
    /**