Code Duplication    Length = 29-31 lines in 2 locations

projects/plugins/jetpack/tests/php/general/test_class.jetpack.php 2 locations

@@ 877-905 (lines=29) @@
874
	 *
875
	 * @group xmlrpc
876
	 */
877
	public function test_classic_xmlrpc_when_active_and_signed_with_no_user() {
878
		$this->mocked_setup_xmlrpc_handlers( array( 'for' => 'jetpack' ), true, true );
879
880
		$methods = apply_filters( 'xmlrpc_methods', array( 'test.test' => '__return_true' ) );
881
882
		$required = array(
883
			'jetpack.verifyAction',
884
			'jetpack.getUser',
885
			'jetpack.remoteRegister',
886
			'jetpack.remoteProvision',
887
			'jetpack.remoteConnect',
888
			'jetpack.jsonAPI',
889
			'jetpack.idcUrlValidation',
890
			'jetpack.unlinkUser',
891
			'jetpack.testConnection',
892
			'jetpack.featuresAvailable',
893
			'jetpack.featuresEnabled',
894
			'jetpack.disconnectBlog',
895
		);
896
897
		$allowed = array(
898
			'jetpack.getHeartbeatData',
899
			'jetpack.syncObject',
900
			'jetpack.updatePublicizeConnections',
901
			'jetpack.getBlog',
902
		);
903
904
		$this->assertXMLRPCMethodsComply( $required, $allowed, array_keys( $methods ) );
905
	}
906
907
	/**
908
	 * Tests the setup of the xmlrpc methods when the site is active, the request is signed, and with a user.
@@ 1051-1081 (lines=31) @@
1048
	 *
1049
	 * @group xmlrpc
1050
	 */
1051
	public function test_classic_xmlrpc_when_not_active_and_signed() {
1052
		$this->mocked_setup_xmlrpc_handlers( array( 'for' => 'jetpack' ), false, true );
1053
1054
		$methods = apply_filters( 'xmlrpc_methods', array( 'test.test' => '__return_true' ) );
1055
1056
		$required = array(
1057
			'jetpack.verifyAction',
1058
			'jetpack.getUser',
1059
			'jetpack.remoteRegister',
1060
			'jetpack.remoteProvision',
1061
			'jetpack.remoteConnect',
1062
			'jetpack.jsonAPI',
1063
1064
			'jetpack.disconnectBlog',
1065
			'jetpack.unlinkUser',
1066
			'jetpack.idcUrlValidation',
1067
			'jetpack.testConnection',
1068
			'jetpack.featuresAvailable',
1069
			'jetpack.featuresEnabled',
1070
1071
			'jetpack.syncObject',
1072
		);
1073
1074
		$allowed = array(
1075
			'jetpack.subscriptions.subscribe',
1076
			'jetpack.updatePublicizeConnections',
1077
			'jetpack.getHeartbeatData',
1078
		);
1079
1080
		$this->assertXMLRPCMethodsComply( $required, $allowed, array_keys( $methods ) );
1081
	}
1082
1083
	/**
1084
	 * Test "wp_getOptions_hook_in_place".