Code Duplication    Length = 11-15 lines in 2 locations

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

@@ 313-323 (lines=11) @@
310
	 *
311
	 * @covers Automattic\Jetpack\Blocks::jetpack_register_block
312
	 */
313
	public function test_jetpack_register_block_with_editor_style() {
314
		add_filter( 'jetpack_is_standalone_block', '__return_false' );
315
		try {
316
			$result = Blocks::jetpack_register_block( 'jetpack/block-with-editor-style' );
317
			$this->assertEquals( 'jetpack/block-with-editor-style', $result->name );
318
			$this->assertEquals( 'jetpack-blocks-editor', $result->editor_style );
319
		} finally {
320
			remove_filter( 'jetpack_is_standalone_block', '__return_false' );
321
		}
322
323
	}
324
325
	/**
326
	 * Test to ensure registering a Jetpack block does not override an existing dependency,
@@ 333-347 (lines=15) @@
330
	 *
331
	 * @covers Automattic\Jetpack\Blocks::jetpack_register_block
332
	 */
333
	public function test_jetpack_register_block_with_existing_editor_style() {
334
		add_filter( 'jetpack_is_standalone_block', '__return_false' );
335
		try {
336
			$result = Blocks::jetpack_register_block(
337
				'jetpack/block-with-existing-editor-style',
338
				array(
339
					'editor_style' => 'custom-editor-style',
340
				)
341
			);
342
			$this->assertEquals( 'jetpack/block-with-existing-editor-style', $result->name );
343
			$this->assertEquals( 'custom-editor-style', $result->editor_style );
344
		} finally {
345
			remove_filter( 'jetpack_is_standalone_block', '__return_false' );
346
		}
347
	}
348
}
349