Code Duplication    Length = 11-15 lines in 2 locations

projects/packages/blocks/tests/php/test-blocks.php 2 locations

@@ 237-247 (lines=11) @@
234
	 *
235
	 * @covers Automattic\Jetpack\Blocks::jetpack_register_block
236
	 */
237
	public function test_jetpack_register_block_with_editor_style() {
238
		add_filter( 'jetpack_is_standalone_block', '__return_false' );
239
		try {
240
			$result = Blocks::jetpack_register_block( 'jetpack/block-with-editor-style' );
241
			$this->assertEquals( 'jetpack/block-with-editor-style', $result->name );
242
			$this->assertEquals( 'jetpack-blocks-editor', $result->editor_style );
243
		} finally {
244
			remove_filter( 'jetpack_is_standalone_block', '__return_false' );
245
		}
246
247
	}
248
249
	/**
250
	 * Test to ensure registering a Jetpack block does not override an existing dependency,
@@ 255-269 (lines=15) @@
252
	 *
253
	 * @covers Automattic\Jetpack\Blocks::jetpack_register_block
254
	 */
255
	public function test_jetpack_register_block_with_existing_editor_style() {
256
		add_filter( 'jetpack_is_standalone_block', '__return_false' );
257
		try {
258
			$result = Blocks::jetpack_register_block(
259
				'jetpack/block-with-existing-editor-style',
260
				array(
261
					'editor_style' => 'custom-editor-style',
262
				)
263
			);
264
			$this->assertEquals( 'jetpack/block-with-existing-editor-style', $result->name );
265
			$this->assertEquals( 'custom-editor-style', $result->editor_style );
266
		} finally {
267
			remove_filter( 'jetpack_is_standalone_block', '__return_false' );
268
		}
269
	}
270
}
271