Code Duplication    Length = 14-14 lines in 6 locations

tests/SiteTreeContentReviewTest.php 6 locations

@@ 136-149 (lines=14) @@
133
        $this->assertEquals("[email protected]", $owners->first()->Email);
134
    }
135
136
    public function testCanNotBeReviewBecauseNoReviewDate()
137
    {
138
        SS_Datetime::set_mock_now("2010-01-01 12:00:00");
139
140
        /** @var Member $author */
141
        $author = $this->objFromFixture("Member", "author");
142
143
        /** @var Page|SiteTreeContentReview $page */
144
        $page = $this->objFromFixture("Page", "no-review");
145
146
        $this->assertFalse($page->canBeReviewedBy($author));
147
148
        SS_Datetime::clear_mock_now();
149
    }
150
151
    public function testCanNotBeReviewedBecauseInFuture()
152
    {
@@ 151-164 (lines=14) @@
148
        SS_Datetime::clear_mock_now();
149
    }
150
151
    public function testCanNotBeReviewedBecauseInFuture()
152
    {
153
        SS_Datetime::set_mock_now("2010-01-01 12:00:00");
154
155
        /** @var Member $author */
156
        $author = $this->objFromFixture("Member", "author");
157
158
        /** @var Page|SiteTreeContentReview $page */
159
        $page = $this->objFromFixture("Page", "staff");
160
161
        $this->assertFalse($page->canBeReviewedBy($author));
162
163
        SS_Datetime::clear_mock_now();
164
    }
165
166
    public function testCanNotBeReviewedByUser()
167
    {
@@ 166-179 (lines=14) @@
163
        SS_Datetime::clear_mock_now();
164
    }
165
166
    public function testCanNotBeReviewedByUser()
167
    {
168
        SS_Datetime::set_mock_now("2010-03-01 12:00:00");
169
170
        /** @var Member $author */
171
        $author = $this->objFromFixture("Member", "author");
172
173
        /** @var Page|SiteTreeContentReview $page */
174
        $page = $this->objFromFixture("Page", "home");
175
176
        $this->assertFalse($page->canBeReviewedBy($author));
177
178
        SS_Datetime::clear_mock_now();
179
    }
180
181
    public function testCanBeReviewedByUser()
182
    {
@@ 181-194 (lines=14) @@
178
        SS_Datetime::clear_mock_now();
179
    }
180
181
    public function testCanBeReviewedByUser()
182
    {
183
        SS_Datetime::set_mock_now("2010-03-01 12:00:00");
184
185
        /** @var Member $author */
186
        $author = $this->objFromFixture("Member", "author");
187
188
        /** @var Page|SiteTreeContentReview $page */
189
        $page = $this->objFromFixture("Page", "staff");
190
191
        $this->assertTrue($page->canBeReviewedBy($author));
192
193
        SS_Datetime::clear_mock_now();
194
    }
195
196
    public function testCanNotBeReviewedByGroup()
197
    {
@@ 196-209 (lines=14) @@
193
        SS_Datetime::clear_mock_now();
194
    }
195
196
    public function testCanNotBeReviewedByGroup()
197
    {
198
        SS_Datetime::set_mock_now("2010-03-01 12:00:00");
199
200
        /** @var Member $author */
201
        $author = $this->objFromFixture("Member", "editor");
202
203
        /** @var Page|SiteTreeContentReview $page */
204
        $page = $this->objFromFixture("Page", "contact");
205
206
        $this->assertFalse($page->canBeReviewedBy($author));
207
208
        SS_Datetime::clear_mock_now();
209
    }
210
211
    public function testCanBeReviewedByGroup()
212
    {
@@ 211-224 (lines=14) @@
208
        SS_Datetime::clear_mock_now();
209
    }
210
211
    public function testCanBeReviewedByGroup()
212
    {
213
        SS_Datetime::set_mock_now("2010-03-01 12:00:00");
214
215
        /** @var Member $author */
216
        $author = $this->objFromFixture("Member", "author");
217
218
        /** @var Page|SiteTreeContentReview $page */
219
        $page = $this->objFromFixture("Page", "contact");
220
221
        $this->assertTrue($page->canBeReviewedBy($author));
222
223
        SS_Datetime::clear_mock_now();
224
    }
225
226
    public function testCanBeReviewedFromInheritedSetting()
227
    {