@@ -4542,79 +4542,6 @@ public function data_varying_versions_handle_args() {
45424542 );
45434543 }
45444544
4545- /**
4546- * Tests that the Classic block is hidden from the inserter by default.
4547- *
4548- * @ticket 65166
4549- *
4550- * @covers ::wp_declare_classic_block_necessary
4551- */
4552- public function test_wp_declare_classic_block_necessary_does_nothing_by_default () {
4553- wp_register_script ( 'wp-block-library ' , 'https://example.org/wp-block-library.js ' );
4554-
4555- wp_declare_classic_block_necessary ();
4556-
4557- $ this ->assertFalse (
4558- wp_scripts ()->get_data ( 'wp-block-library ' , 'before ' ),
4559- 'No inline script should be enqueued when the filter is not used. '
4560- );
4561- }
4562-
4563- /**
4564- * Tests that the Classic block can be opted into the inserter via the filter.
4565- *
4566- * @ticket 65166
4567- *
4568- * @covers ::wp_declare_classic_block_necessary
4569- */
4570- public function test_wp_declare_classic_block_necessary_enqueues_flag_when_filter_enabled () {
4571- wp_register_script ( 'wp-block-library ' , 'https://example.org/wp-block-library.js ' );
4572- add_filter ( 'wp_classic_block_supports_inserter ' , '__return_true ' );
4573-
4574- wp_declare_classic_block_necessary ();
4575-
4576- $ before = wp_scripts ()->get_data ( 'wp-block-library ' , 'before ' );
4577- $ this ->assertIsArray (
4578- $ before ,
4579- 'An inline script should be enqueued when the filter opts in. '
4580- );
4581- $ this ->assertContains (
4582- 'window.__needsClassicBlock = true; ' ,
4583- $ before ,
4584- 'The Classic block flag should be added to the wp-block-library inline scripts. '
4585- );
4586- }
4587-
4588- /**
4589- * Tests that the current post is passed to the filter.
4590- *
4591- * @ticket 65166
4592- *
4593- * @covers ::wp_declare_classic_block_necessary
4594- */
4595- public function test_wp_declare_classic_block_necessary_passes_post_to_filter () {
4596- wp_register_script ( 'wp-block-library ' , 'https://example.org/wp-block-library.js ' );
4597-
4598- $ post_id = self ::factory ()->post ->create ();
4599- $ GLOBALS ['post ' ] = get_post ( $ post_id );
4600-
4601- $ filter_post = false ;
4602- add_filter (
4603- 'wp_classic_block_supports_inserter ' ,
4604- static function ( $ supports_inserter , $ post ) use ( &$ filter_post ) {
4605- $ filter_post = $ post ;
4606- return $ supports_inserter ;
4607- },
4608- 10 ,
4609- 2
4610- );
4611-
4612- wp_declare_classic_block_necessary ();
4613-
4614- $ this ->assertInstanceOf ( WP_Post::class, $ filter_post , 'The post should be passed to the filter. ' );
4615- $ this ->assertSame ( $ post_id , $ filter_post ->ID , 'The current post should be passed to the filter. ' );
4616- }
4617-
46184545 /**
46194546 * Normalizes markup for snapshot.
46204547 *
0 commit comments