Code Duplication    Length = 8-11 lines in 8 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)$/

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

@@ 110-120 (lines=11) @@
107
     * @Then the string block :name should appear in the store
108
     * @Then I should see the string block :name in the list
109
     */
110
    public function theStringBlockShouldAppearInTheStore($name)
111
    {
112
        if (!$this->indexPage->isOpen()) {
113
            $this->indexPage->open();
114
        }
115
116
        Assert::true(
117
            $this->indexPage->isSingleResourceOnPage(['name' => $name]),
118
            sprintf('Could not find string block with name "%s"!', $name)
119
        );
120
    }
121
122
    /**
123
     * @Then I should see :amount string blocks in the list
@@ 137-147 (lines=11) @@
134
    /**
135
     * @Then the string block :name should not be added
136
     */
137
    public function theStringBlockShouldNotBeAdded($name)
138
    {
139
        if (!$this->indexPage->isOpen()) {
140
            $this->indexPage->open();
141
        }
142
143
        Assert::false(
144
            $this->indexPage->isSingleResourceOnPage(['name' => $name]),
145
            sprintf('Static content with name %s was created, but it should not.', $name)
146
        );
147
    }
148
149
    /**
150
     * @Given /^I want to edit (this string block)$/

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

@@ 134-144 (lines=11) @@
131
     * @Then the custom block :name should appear in the store
132
     * @Then I should see the custom block :name in the list
133
     */
134
    public function theCustomBlockShouldAppearInTheStore($name)
135
    {
136
        if (!$this->indexPage->isOpen()) {
137
            $this->indexPage->open();
138
        }
139
140
        Assert::true(
141
            $this->indexPage->isSingleResourceOnPage(['name' => $name]),
142
            sprintf('Could not find custom block with name "%s"!', $name)
143
        );
144
    }
145
146
    /**
147
     * @Then I should see :amount custom blocks in the list
@@ 161-171 (lines=11) @@
158
    /**
159
     * @Then the custom block :name should not be added
160
     */
161
    public function theCustomBlockShouldNotBeAdded($name)
162
    {
163
        if (!$this->indexPage->isOpen()) {
164
            $this->indexPage->open();
165
        }
166
167
        Assert::false(
168
            $this->indexPage->isSingleResourceOnPage(['name' => $name]),
169
            sprintf('Static content with name %s was created, but it should not.', $name)
170
        );
171
    }
172
173
    /**
174
     * @When /^I preview (this custom block)$/