From 0ea3d0b3d849683117a055428d76ca4ad502104d Mon Sep 17 00:00:00 2001 From: Erick Hitter <git-contrib@ethitter.com> Date: Sun, 5 Jun 2022 16:04:04 -0700 Subject: [PATCH] Scaffold new tests --- inc/class-block-editor.php | 13 ---------- tests/test-block-editor.php | 49 +++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 tests/test-block-editor.php diff --git a/inc/class-block-editor.php b/inc/class-block-editor.php index c13061f..52cbd6c 100644 --- a/inc/class-block-editor.php +++ b/inc/class-block-editor.php @@ -34,19 +34,6 @@ class Block_Editor { add_action( 'rest_api_init', array( $this, 'action_rest_api_init' ) ); add_filter( 'is_protected_meta', array( $this, 'filter_is_protected_meta' ), 10, 2 ); add_action( $this->cron_action, array( WP_Revisions_Control::get_instance(), 'do_purge_excess' ), 10, 2 ); - add_action( 'admin_init', array( $this, 'action_admin_init' ) ); - } - - /** - * Register admin-only hooks. - * - * @return void - */ - public function action_admin_init() { - if ( ! function_exists( 'use_block_editor_for_post' ) ) { - return; - } - add_action( 'enqueue_block_editor_assets', array( $this, 'action_enqueue_block_editor_assets' ) ); } diff --git a/tests/test-block-editor.php b/tests/test-block-editor.php new file mode 100644 index 0000000..01b2bce --- /dev/null +++ b/tests/test-block-editor.php @@ -0,0 +1,49 @@ +<?php +/** + * Test block-editor features. + * + * @package WP_Revisions_Control + */ + +/** + * Class TestBlockEditor. + * + * @coversDefaultClass \WP_Revisions_Control\Block_Editor + */ +class TestBlockEditor extends WP_UnitTestCase { + /** + * Test REST API additions. + * + * @covers ::action_rest_api_init() + */ + public function test_action_rest_api_init() { + $this->markTestIncomplete(); + } + + /** + * Test REST permissions callback. + * + * @covers ::rest_api_permission_callback() + */ + public function test_rest_api_permission_callback() { + $this->markTestIncomplete(); + } + + /** + * Test scheduling. + * + * @covers ::rest_api_schedule_purge() + */ + public function test_rest_api_schedule_purge() { + $this->markTestIncomplete(); + } + + /** + * Test override for what is considered protected meta. + * + * @covers ::filter_is_protected_meta() + */ + public function test_filter_is_protected_meta() { + $this->markTestIncomplete(); + } +} -- GitLab