Code Duplication    Length = 23-23 lines in 2 locations

packages/options/tests/Manager.php 2 locations

@@ 141-163 (lines=23) @@
138
		$this->assertTrue( $deleted );
139
	}
140
141
	function test_update_non_compact_option_returns_true_when_successfully_updated() {
142
		\WP_Mock::expectAction(
143
			'pre_update_jetpack_option_uncompact_option_name',
144
			'uncompact_option_name',
145
			true
146
		);
147
148
		\WP_Mock::userFunction( 'update_option', array(
149
			'times' => 1,
150
			'args' => array( 'jetpack_uncompact_option_name', true, NULL ),
151
			'return' => true,
152
		) );
153
		\WP_Mock::userFunction( 'is_multisite', array(
154
			'times' => 1,
155
			'args' => array(),
156
			'return' => false,
157
		) );
158
159
		$updated = $this->manager->update_option( 'uncompact_option_name', true );
160
161
		// Did Jetpack_Options::delete_option() properly return true?
162
		$this->assertTrue( $updated );
163
	}
164
165
	function test_update_network_option_returns_true_when_successfully_updated() {
166
		\WP_Mock::expectAction(
@@ 165-187 (lines=23) @@
162
		$this->assertTrue( $updated );
163
	}
164
165
	function test_update_network_option_returns_true_when_successfully_updated() {
166
		\WP_Mock::expectAction(
167
			'pre_update_jetpack_option_network_name',
168
			'network_name',
169
			true
170
		);
171
172
		\WP_Mock::userFunction( 'update_site_option', array(
173
			'times' => 1,
174
			'args' => array( 'jetpack_network_name', true ),
175
			'return' => true,
176
		) );
177
		\WP_Mock::userFunction( 'is_multisite', array(
178
			'times' => 1,
179
			'args' => array(),
180
			'return' => true,
181
		) );
182
183
		$updated = $this->manager->update_option( 'network_name', true );
184
185
		// Did Jetpack_Options::update_option() properly return true?
186
		$this->assertTrue( $updated );
187
	}
188
189
	function test_update_private_option_returns_true_when_successfully_updated() {
190
		\WP_Mock::expectAction(