Code Duplication    Length = 9-11 lines in 2 locations

projects/plugins/jetpack/tests/php/modules/contact-form/test-class.grunion-contact-form.php 2 locations

@@ 477-485 (lines=9) @@
474
	 *
475
	 * @author tonykova
476
	 */
477
	public function test_process_submission_wont_send_spam_if_marked_as_spam_with_true() {
478
		add_filter( 'jetpack_contact_form_is_spam', '__return_true', 11 ); // Run after akismet filter.
479
480
		add_filter( 'wp_mail', array( $this, 'pre_test_process_submission_wont_send_spam_if_marked_as_spam_with_true' ) );
481
482
		$form   = new Grunion_Contact_Form( array( 'to' => '[email protected]' ) );
483
		$result = $form->process_submission();
484
		$this->assertNotNull( $result );
485
	}
486
487
	/**
488
	 * This method is hooked to the wp-mail filter, and the test will fail if this method is called.
@@ 499-509 (lines=11) @@
496
	 *
497
	 * @author tonykova
498
	 */
499
	public function test_process_submission_labels_message_as_spam_in_subject_if_marked_as_spam_with_true_and_sending_spam() {
500
		add_filter( 'jetpack_contact_form_is_spam', '__return_true', 11 ); // Run after akismet filter.
501
502
		add_filter( 'grunion_still_email_spam', '__return_true' );
503
504
		add_filter( 'wp_mail', array( $this, 'pre_test_process_submission_labels_message_as_spam_in_subject_if_marked_as_spam_with_true_and_sending_spam' ) );
505
506
		$form   = new Grunion_Contact_Form( array( 'to' => '[email protected]' ) );
507
		$result = $form->process_submission();
508
		$this->assertNotNull( $result );
509
	}
510
511
	/**
512
	 * This method is hooked to the wp-mail filter.