Code Duplication    Length = 8-11 lines in 4 locations

src/Tests/Behat/Context/Ui/Admin/ManagingRoutesContext.php 2 locations

@@ 90-100 (lines=11) @@
87
     * @Then the route :name should appear in the store
88
     * @Then I should see the route :name in the list
89
     */
90
    public function theRouteShouldAppearInTheStore($name)
91
    {
92
        if (!$this->indexPage->isOpen()) {
93
            $this->indexPage->open();
94
        }
95
96
        Assert::true(
97
            $this->indexPage->isSingleResourceOnPage(['name' => $name]),
98
            sprintf('Could not find route with name "%s"!', $name)
99
        );
100
    }
101
102
    /**
103
     * @Then I should see :amount routes in the list
@@ 188-198 (lines=11) @@
185
    /**
186
     * @Then the route with content :title should not be added
187
     */
188
    public function theRouteWithContentShouldNotBeAdded($title)
189
    {
190
        if (!$this->indexPage->isOpen()) {
191
            $this->indexPage->open();
192
        }
193
194
        Assert::false(
195
            $this->indexPage->isSingleResourceOnPage(['content' => $title]),
196
            sprintf('Found route with content "%s" assigned, but expected not to.', $title)
197
        );
198
    }
199
}
200

src/Tests/Behat/Context/Ui/Admin/ManagingStaticContentsContext.php 2 locations

@@ 109-116 (lines=8) @@
106
     * @Then the static content :title should appear in the store
107
     * @Then I should see the static content :title in the list
108
     */
109
    public function theStaticContentShouldAppearInTheStore($title)
110
    {
111
        if (!$this->indexPage->isOpen()) {
112
            $this->indexPage->open();
113
        }
114
115
        Assert::true($this->indexPage->isSingleResourceOnPage(['title' => $title]));
116
    }
117
118
    /**
119
     * @Then I should see :amount static contents in the list
@@ 133-140 (lines=8) @@
130
    /**
131
     * @Then the static content :title should not be added
132
     */
133
    public function theStaticContentShouldNotBeAdded($title)
134
    {
135
        if (!$this->indexPage->isOpen()) {
136
            $this->indexPage->open();
137
        }
138
139
        Assert::false($this->indexPage->isSingleResourceOnPage(['title' => $title]));
140
    }
141
142
    /**
143
     * @Given /^I want to edit (this static content)$/