Code Duplication    Length = 7-8 lines in 3 locations

src/SilverStripe/BehatExtension/Context/BasicContext.php 3 locations

@@ 796-802 (lines=7) @@
793
    /**
794
     * @Then /^the "([^"]*)" table should contain "([^"]*)"$/
795
     */
796
    public function theTableShouldContain($selector, $text)
797
    {
798
        $table = $this->getTable($selector);
799
800
        $element = $table->find('named', array('content', "'$text'"));
801
        assertNotNull($element, sprintf('Element containing `%s` not found in `%s` table', $text, $selector));
802
    }
803
804
    /**
805
     * @Then /^the "([^"]*)" table should not contain "([^"]*)"$/
@@ 807-813 (lines=7) @@
804
    /**
805
     * @Then /^the "([^"]*)" table should not contain "([^"]*)"$/
806
     */
807
    public function theTableShouldNotContain($selector, $text)
808
    {
809
        $table = $this->getTable($selector);
810
811
        $element = $table->find('named', array('content', "'$text'"));
812
        assertNull($element, sprintf('Element containing `%s` not found in `%s` table', $text, $selector));
813
    }
814
815
    /**
816
     * @Given /^I click on "([^"]*)" in the "([^"]*)" table$/
@@ 818-825 (lines=8) @@
815
    /**
816
     * @Given /^I click on "([^"]*)" in the "([^"]*)" table$/
817
     */
818
    public function iClickOnInTheTable($text, $selector)
819
    {
820
        $table = $this->getTable($selector);
821
822
        $element = $table->find('xpath', sprintf('//*[count(*)=0 and contains(.,"%s")]', $text));
823
        assertNotNull($element, sprintf('Element containing `%s` not found', $text));
824
        $element->click();
825
    }
826
827
    /**
828
     * Finds the first visible table by various factors: