Code Duplication    Length = 14-15 lines in 2 locations

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

@@ 32-45 (lines=14) @@
29
    /**
30
     * @When :name should be default contact
31
     */
32
    public function assertDefaultContact($name)
33
    {
34
        $contactBoxes = $this->getSession()->getPage()->findAll('css', '.contact-box');
35
36
        /** @var NodeElement $box */
37
        foreach ($contactBoxes as $box) {
38
            if (false !== strpos($box->getText(), $name)) {
39
                self::assertRegExp('/Default Contact/i', $box->getText());
40
                return;
41
            }
42
        }
43
44
        self::fail(sprintf('Can\'t find contact with "%s" name', $name));
45
    }
46
47
48
    /**

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