Code Duplication    Length = 13-13 lines in 2 locations

src/SilverStripe/BehatExtension/Context/EmailContext.php 2 locations

@@ 261-273 (lines=13) @@
258
	/**
259
	 * @Then /^the email should (not |)be sent from "([^"]*)"$/
260
	 */
261
	public function theEmailSentFrom($negate, $from)
262
	{
263
		if(!$this->lastMatchedEmail) {
264
			throw new \LogicException('No matched email found from previous step');
265
		}
266
267
		$match = $this->lastMatchedEmail;
268
		if(trim($negate)) {
269
			assertNotContains($from, $match->From);
270
		} else {
271
			assertContains($from, $match->From);
272
		}
273
	}
274
275
	/**
276
	 * @Then /^the email should (not |)be sent to "([^"]*)"$/
@@ 278-290 (lines=13) @@
275
	/**
276
	 * @Then /^the email should (not |)be sent to "([^"]*)"$/
277
	 */
278
	public function theEmailSentTo($negate, $to)
279
	{
280
		if(!$this->lastMatchedEmail) {
281
			throw new \LogicException('No matched email found from previous step');
282
		}
283
284
		$match = $this->lastMatchedEmail;
285
		if(trim($negate)) {
286
			assertNotContains($to, $match->To);
287
		} else {
288
			assertContains($to, $match->To);
289
		}
290
	}
291
}
292