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/ManagingCustomBlocksContext.php 2 locations

@@ 125-135 (lines=11) @@
122
     * @Then the custom block :name should appear in the store
123
     * @Then I should see the custom block :name in the list
124
     */
125
    public function theCustomBlockShouldAppearInTheStore($name)
126
    {
127
        if (!$this->indexPage->isOpen()) {
128
            $this->indexPage->open();
129
        }
130
131
        Assert::true(
132
            $this->indexPage->isSingleResourceOnPage(['name' => $name]),
133
            sprintf('Could not find custom block with name "%s"!', $name)
134
        );
135
    }
136
137
    /**
138
     * @Then I should see :amount custom blocks in the list
@@ 152-162 (lines=11) @@
149
    /**
150
     * @Then the custom block :name should not be added
151
     */
152
    public function theCustomBlockShouldNotBeAdded($name)
153
    {
154
        if (!$this->indexPage->isOpen()) {
155
            $this->indexPage->open();
156
        }
157
158
        Assert::false(
159
            $this->indexPage->isSingleResourceOnPage(['name' => $name]),
160
            sprintf('Static content with name %s was created, but it should not.', $name)
161
        );
162
    }
163
164
    /**
165
     * @Given /^I want to edit (this custom block)$/

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)$/