diff --git a/admin-functions.php b/admin-functions.php index cb8695070..8067a3bd1 100644 --- a/admin-functions.php +++ b/admin-functions.php @@ -20,6 +20,8 @@ /** * Wrapper for the option 'duplicate_post_version'. + * + * @return mixed */ function duplicate_post_get_installed_version() { return get_option( 'duplicate_post_version' ); @@ -27,6 +29,8 @@ function duplicate_post_get_installed_version() { /** * Wrapper for the defined constant DUPLICATE_POST_CURRENT_VERSION. + * + * @return string */ function duplicate_post_get_current_version() { return DUPLICATE_POST_CURRENT_VERSION; @@ -36,6 +40,8 @@ function duplicate_post_get_current_version() { /** * Adds handlers depending on the options. + * + * @return void */ function duplicate_post_admin_init() { duplicate_post_plugin_upgrade(); @@ -76,6 +82,8 @@ function duplicate_post_admin_init() { /** * Plugin upgrade. + * + * @return void */ function duplicate_post_plugin_upgrade() { $installed_version = duplicate_post_get_installed_version(); @@ -203,6 +211,8 @@ function duplicate_post_migrate_show_links_in_options( $defaults ) { * Shows the welcome notice. * * @global string $wp_version The WordPress version string. + * + * @return void */ function duplicate_post_show_update_notice() { if ( ! current_user_can( 'manage_options' ) ) { @@ -268,6 +278,8 @@ function duplicate_post_dismiss_notice() { * * @param int $new_id New post ID. * @param WP_Post $post The original post object. + * + * @return void */ function duplicate_post_copy_post_taxonomies( $new_id, $post ) { global $wpdb; @@ -316,6 +328,8 @@ function duplicate_post_copy_post_taxonomies( $new_id, $post ) { * * @param int $new_id The new post ID. * @param WP_Post $post The original post object. + * + * @return void */ function duplicate_post_copy_post_meta_info( $new_id, $post ) { $post_meta_keys = get_post_custom_keys( $post->ID ); @@ -425,6 +439,8 @@ function duplicate_post_wp_slash( $value ) { * * @param int $new_id The new post ID. * @param WP_Post $post The original post object. + * + * @return void */ function duplicate_post_copy_attachments( $new_id, $post ) { // Get thumbnail ID. @@ -489,6 +505,8 @@ function duplicate_post_copy_attachments( $new_id, $post ) { * @param int $new_id The new post ID. * @param WP_Post $post The original post object. * @param string $status Optional. The destination status. + * + * @return void */ function duplicate_post_copy_children( $new_id, $post, $status = '' ) { // Get children. @@ -514,6 +532,8 @@ function duplicate_post_copy_children( $new_id, $post, $status = '' ) { * * @param int $new_id The new post ID. * @param WP_Post $post The original post object. + * + * @return void */ function duplicate_post_copy_comments( $new_id, $post ) { $comments = get_comments( @@ -737,9 +757,9 @@ function duplicate_post_create_duplicate( $post, $status = '', $parent_id = '' ) /** * Adds some links on the plugin page. * - * @param array $links The links array. - * @param string $file The file name. - * @return array + * @param array $links The links array. + * @param string $file The file name. + * @return array */ function duplicate_post_add_plugin_links( $links, $file ) { if ( plugin_basename( __DIR__ . '/duplicate-post.php' ) === $file ) { diff --git a/common-functions.php b/common-functions.php index 28545d7d4..070b108a2 100644 --- a/common-functions.php +++ b/common-functions.php @@ -63,6 +63,8 @@ function duplicate_post_get_clone_post_link( $id = 0, $context = 'display', $dra * @param string $before Optional. Display before edit link. * @param string $after Optional. Display after edit link. * @param int $id Optional. Post ID. + * + * @return void */ function duplicate_post_clone_post_link( $link = null, $before = '', $after = '', $id = 0 ) { $post = get_post( $id ); diff --git a/compat/jetpack-functions.php b/compat/jetpack-functions.php index 46819e440..457ee7ff1 100644 --- a/compat/jetpack-functions.php +++ b/compat/jetpack-functions.php @@ -10,6 +10,8 @@ /** * Add handlers for JetPack compatibility. + * + * @return void */ function duplicate_post_jetpack_init() { add_filter( 'duplicate_post_excludelist_filter', 'duplicate_post_jetpack_add_to_excludelist', 10, 1 ); @@ -39,6 +41,8 @@ function duplicate_post_jetpack_add_to_excludelist( $meta_excludelist ) { * Disable Markdown. * * To be called before copy. + * + * @return void */ function duplicate_post_jetpack_disable_markdown() { WPCom_Markdown::get_instance()->unload_markdown_for_posts(); @@ -48,6 +52,8 @@ function duplicate_post_jetpack_disable_markdown() { * Enaable Markdown. * * To be called after copy. + * + * @return void */ function duplicate_post_jetpack_enable_markdown() { WPCom_Markdown::get_instance()->load_markdown_for_posts(); diff --git a/compat/wpml-functions.php b/compat/wpml-functions.php index 91991d06e..9c038ee47 100644 --- a/compat/wpml-functions.php +++ b/compat/wpml-functions.php @@ -12,6 +12,8 @@ /** * Add handlers for WPML compatibility. + * + * @return void */ function duplicate_post_wpml_init() { if ( defined( 'ICL_SITEPRESS_VERSION' ) ) { @@ -35,6 +37,8 @@ function duplicate_post_wpml_init() { * @param int $post_id ID of the copy. * @param WP_Post $post Original post object. * @param string $status Status of the new post. + * + * @return void */ function duplicate_post_wpml_copy_translations( $post_id, $post, $status = '' ) { global $sitepress; @@ -78,6 +82,8 @@ function duplicate_post_wpml_copy_translations( $post_id, $post, $status = '' ) * Duplicate string packages. * * @global array() $duplicated_posts Array of duplicated posts. + * + * @return void */ function duplicate_wpml_string_packages() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals -- Reason: renaming the function would be a BC-break. global $duplicated_posts; diff --git a/duplicate-post.php b/duplicate-post.php index f777a690d..b801c1047 100644 --- a/duplicate-post.php +++ b/duplicate-post.php @@ -68,6 +68,8 @@ * @phpcs:disable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore * @phpcs:disable WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore * @phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound + * + * @return void */ function __duplicate_post_main() { new Duplicate_Post(); @@ -76,6 +78,8 @@ function __duplicate_post_main() { /** * Initialises the internationalisation domain. + * + * @return void */ function duplicate_post_load_plugin_textdomain() { load_plugin_textdomain( 'duplicate-post', false, basename( __DIR__ ) . '/languages/' ); diff --git a/src/admin/options-form-generator.php b/src/admin/options-form-generator.php index dbe9d13ba..4be10afc5 100644 --- a/src/admin/options-form-generator.php +++ b/src/admin/options-form-generator.php @@ -127,8 +127,8 @@ public function sort_taxonomy_objects( $taxonomy1, $taxonomy2 ) { /** * Extracts and formats the description associated with the input field. * - * @param string|array $description The description string. Can be an array of strings. - * @param string $id The ID of the input field. + * @param string|array $description The description string. Can be an array of strings. + * @param string $id The ID of the input field. * * @return string The description HTML for the input. */ diff --git a/src/post-duplicator.php b/src/post-duplicator.php index 3f0320590..ccb6e836a 100644 --- a/src/post-duplicator.php +++ b/src/post-duplicator.php @@ -15,7 +15,7 @@ class Post_Duplicator { /** * Returns an array with the default option values. * - * @return array The default options values. + * @return array The default options values. */ public function get_default_options() { return [ diff --git a/src/ui/block-editor.php b/src/ui/block-editor.php index db6b4243f..b00692dc1 100644 --- a/src/ui/block-editor.php +++ b/src/ui/block-editor.php @@ -223,7 +223,7 @@ public function get_original_post_edit_url() { * * @param WP_Post $post The current post object. * - * @return array The data to pass to JavaScript. + * @return array The data to pass to JavaScript. */ protected function generate_js_object( WP_Post $post ) { $is_rewrite_and_republish_copy = $this->permissions_helper->is_rewrite_and_republish_copy( $post ); diff --git a/src/ui/newsletter.php b/src/ui/newsletter.php index 9b247025f..f391463c1 100644 --- a/src/ui/newsletter.php +++ b/src/ui/newsletter.php @@ -69,7 +69,7 @@ public static function newsletter_signup_form() { /** * Handles and validates Newsletter form. * - * @return array|null + * @return array|null */ private static function newsletter_handle_form() { @@ -105,7 +105,7 @@ private static function newsletter_handle_form() { * * @param string $email Subscriber email. * - * @return array Feedback response. + * @return array Feedback response. */ private static function newsletter_subscribe_to_mailblue( $email ) { $response = \wp_remote_post( diff --git a/src/utils.php b/src/utils.php index b2fd62eb7..e41649ed5 100644 --- a/src/utils.php +++ b/src/utils.php @@ -177,7 +177,7 @@ public static function get_roles() { /** * Gets the default meta field names to be filtered out. * - * @return array The names of the meta fields to filter out by default. + * @return array The names of the meta fields to filter out by default. */ public static function get_default_filtered_meta_names() { return [ diff --git a/tests/Unit/Admin/Options_Form_Generator_Test.php b/tests/Unit/Admin/Options_Form_Generator_Test.php index 943677cd9..45ef60260 100644 --- a/tests/Unit/Admin/Options_Form_Generator_Test.php +++ b/tests/Unit/Admin/Options_Form_Generator_Test.php @@ -32,6 +32,8 @@ final class Options_Form_Generator_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -76,6 +78,8 @@ protected function set_up() { * Tests the constructor of the class. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::__construct + * + * @return void */ public function test_constructor() { $this->instance->__construct( $this->options_inputs ); @@ -90,6 +94,8 @@ public function test_constructor() { * Tests the generation of options input elements. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::generate_options_input + * + * @return void */ public function test_generate_options_input_generated_output() { $this->options_inputs->allows( @@ -134,6 +140,8 @@ public function test_generate_options_input_generated_output() { * Tests the calling of the correct methods when generating inputs. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::generate_options_input + * + * @return void */ public function test_generate_options_input_calls_expected_methods() { $options = [ @@ -178,6 +186,8 @@ public function test_generate_options_input_calls_expected_methods() { * Tests the skipping of generation of options input elements when the option is empty. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::generate_options_input + * + * @return void */ public function test_dont_generate_options_input_from_empty_options() { $options = [ @@ -191,6 +201,8 @@ public function test_dont_generate_options_input_from_empty_options() { * Tests the skipping of generation of option input elements when the WordPress version isn't high enough. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::generate_options_input + * + * @return void */ public function test_dont_generate_options_input_for_invalid_version() { $options = [ @@ -230,6 +242,8 @@ public function test_dont_generate_options_input_for_invalid_version() { * Tests the generation of sub option input elements. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::generate_options_input + * + * @return void */ public function test_generate_options_input_for_suboptions() { $options = [ @@ -264,6 +278,8 @@ static function ( $checked, $current = true ) { * Tests the extraction of descriptions. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::extract_description + * + * @return void */ public function test_extract_description() { $this->assertSame( @@ -292,6 +308,8 @@ public function test_extract_description() { * Tests the generate_taxonomy_exclusion_list callback method. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::generate_taxonomy_exclusion_list + * + * @return void */ public function test_generate_taxonomy_exclusion_list() { $labels1 = new stdClass(); @@ -362,6 +380,8 @@ static function ( $checked, $current = true ) { * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::generate_roles_permission_list * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_generate_roles_permission_list() { $this->stub_wp_roles(); @@ -396,6 +416,8 @@ static function ( $checked, $current = true ) { * Tests the generate_post_types_list callback method. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::generate_post_types_list + * + * @return void */ public function test_generate_post_types_list() { $this->instance @@ -438,10 +460,12 @@ static function ( $checked, $current = true ) { * @dataProvider is_checked_provider * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::is_checked * - * @param string $option The option name. - * @param array $option_values The option values. - * @param string $parent_option The parent option. - * @param array $assertion The assumed assertion values. + * @param string $option The option name. + * @param array $option_values The option values. + * @param string $parent_option The parent option. + * @param array $assertion The assumed assertion values. + * + * @return void */ public function test_is_checked( $option, $option_values, $parent_option, $assertion = [] ) { if ( $assertion['expected'] === false ) { @@ -467,7 +491,7 @@ public function test_is_checked( $option, $option_values, $parent_option, $asser /** * Provides the test_is_checked test with data to use in the tests. * - * @return array The data to run the test against. + * @return array>> The data to run the test against. */ public static function is_checked_provider() { return [ @@ -505,6 +529,8 @@ public static function is_checked_provider() { * Tests the prepare_input_id helper method. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Form_Generator::prepare_input_id + * + * @return void */ public function test_prepare_input_id() { $this->assertSame( 'my-form-element-id', $this->instance->prepare_input_id( 'my_form_element_id' ) ); diff --git a/tests/Unit/Admin/Options_Inputs_Test.php b/tests/Unit/Admin/Options_Inputs_Test.php index 622b7b7b4..0c3dbfa6e 100644 --- a/tests/Unit/Admin/Options_Inputs_Test.php +++ b/tests/Unit/Admin/Options_Inputs_Test.php @@ -21,6 +21,8 @@ final class Options_Inputs_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -34,6 +36,8 @@ protected function set_up() { * Tests the creation of a checkbox input. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Inputs::checkbox + * + * @return void */ public function test_checkbox() { Functions\expect( 'checked' ) @@ -59,6 +63,8 @@ static function ( $checked, $current = true ) { * Tests the creation of a checkbox input. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Inputs::text + * + * @return void */ public function test_text() { $this->assertSame( @@ -71,6 +77,8 @@ public function test_text() { * Tests the creation of a checkbox input. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Inputs::number + * + * @return void */ public function test_number() { $this->assertSame( diff --git a/tests/Unit/Admin/Options_Page_Test.php b/tests/Unit/Admin/Options_Page_Test.php index f111a042c..6111a4afd 100644 --- a/tests/Unit/Admin/Options_Page_Test.php +++ b/tests/Unit/Admin/Options_Page_Test.php @@ -45,6 +45,8 @@ final class Options_Page_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -63,6 +65,8 @@ protected function set_up() { * Tests the constructor of the class. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Page::__construct + * + * @return void */ public function test_constructor() { $this->instance->__construct( $this->options, $this->form_generator, $this->asset_manager ); @@ -82,6 +86,8 @@ public function test_constructor() { * Tests the registration of the hooks when in the admin. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Page::register_hooks + * + * @return void */ public function test_register_hooks_when_in_admin() { Monkey\Functions\stubs( [ 'is_admin' => true ] ); @@ -100,6 +106,8 @@ public function test_register_hooks_when_in_admin() { * Tests the registration of the hooks doesn't fire when not in the admin. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Page::register_hooks + * + * @return void */ public function test_no_register_hooks_when_not_in_admin() { Monkey\Functions\stubs( [ 'is_admin' => false ] ); @@ -118,6 +126,8 @@ public function test_no_register_hooks_when_not_in_admin() { * Tests the loading of the assets. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Page::enqueue_assets + * + * @return void */ public function test_loading_of_assets() { $this->asset_manager @@ -133,6 +143,8 @@ public function test_loading_of_assets() { * Tests the loading of the assets. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Page::register_menu + * + * @return void */ public function test_register_menu() { $this->stubTranslationFunctions(); @@ -163,6 +175,8 @@ public function test_register_menu() { * @covers \Yoast\WP\Duplicate_Post\Admin\Options_Page::register_capabilities * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_register_capabilities() { $this->stub_wp_roles(); diff --git a/tests/Unit/Admin/Options_Test.php b/tests/Unit/Admin/Options_Test.php index 7135774dd..106db5d29 100644 --- a/tests/Unit/Admin/Options_Test.php +++ b/tests/Unit/Admin/Options_Test.php @@ -22,12 +22,14 @@ final class Options_Test extends TestCase { /** * The fake options array. * - * @var array[] + * @var array> */ protected $fake_options; /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -62,6 +64,8 @@ protected function set_up() { * Tests the registration of the settings. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options::register_settings + * + * @return void */ public function test_register_settings() { foreach ( \array_keys( $this->fake_options ) as $fake_option ) { @@ -77,6 +81,8 @@ public function test_register_settings() { * Tests that only options for the first tab are retrieved. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options::get_options_for_tab + * + * @return void */ public function test_get_options_for_first_tab() { $options = $this->instance->get_options_for_tab( 'tab1' ); @@ -105,6 +111,8 @@ public function test_get_options_for_first_tab() { * Tests that only options for the first tab and fieldset are retrieved. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options::get_options_for_tab + * + * @return void */ public function test_get_options_for_first_tab_and_fieldset() { $options = $this->instance->get_options_for_tab( 'tab1', 'fieldset1' ); @@ -127,6 +135,8 @@ public function test_get_options_for_first_tab_and_fieldset() { * Tests that no options are retrieved for a non-existent tab. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options::get_options_for_tab + * + * @return void */ public function test_get_options_for_non_existing_tab() { $options = $this->instance->get_options_for_tab( 'tab3' ); @@ -138,6 +148,8 @@ public function test_get_options_for_non_existing_tab() { * Tests that no options are retrieved for a non-existent fieldset. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options::get_options_for_tab + * + * @return void */ public function test_get_options_for_non_existing_fieldset() { $options = $this->instance->get_options_for_tab( 'tab1', 'fieldset2' ); @@ -149,6 +161,8 @@ public function test_get_options_for_non_existing_fieldset() { * Tests that retrieving a single, existing option, returns the option. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options::get_option + * + * @return void */ public function test_get_valid_option() { $options = $this->instance->get_option( 'option_1' ); @@ -171,6 +185,8 @@ public function test_get_valid_option() { * Tests that retrieving a single, non-existent option, returns an empty array. * * @covers \Yoast\WP\Duplicate_Post\Admin\Options::get_option + * + * @return void */ public function test_get_invalid_option() { $options = $this->instance->get_option( 'option_4' ); diff --git a/tests/Unit/Handlers/Check_Changes_Handler_Test.php b/tests/Unit/Handlers/Check_Changes_Handler_Test.php index 85e89b4e7..e194d372b 100644 --- a/tests/Unit/Handlers/Check_Changes_Handler_Test.php +++ b/tests/Unit/Handlers/Check_Changes_Handler_Test.php @@ -30,6 +30,8 @@ final class Check_Changes_Handler_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -46,6 +48,8 @@ protected function set_up() { * Tests the constructor. * * @covers \Yoast\WP\Duplicate_Post\Handlers\Check_Changes_Handler::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -58,6 +62,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\Handlers\Check_Changes_Handler::register_hooks + * + * @return void */ public function test_register_hooks() { $this->instance->register_hooks(); @@ -71,6 +77,8 @@ public function test_register_hooks() { * @covers \Yoast\WP\Duplicate_Post\Handlers\Check_Changes_Handler::check_changes_action_handler * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_check_changes_action_handler_successful() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -153,6 +161,8 @@ public function test_check_changes_action_handler_successful() { * Tests the check_changes_action_handler function when no ID has been passed in the query. * * @covers \Yoast\WP\Duplicate_Post\Handlers\Check_Changes_Handler::check_changes_action_handler + * + * @return void */ public function test_check_changes_action_handler_no_id_in_query() { Monkey\Functions\expect( '\wp_die' ) @@ -165,6 +175,8 @@ public function test_check_changes_action_handler_no_id_in_query() { * Tests the check_changes_action_handler function when there is no post. * * @covers \Yoast\WP\Duplicate_Post\Handlers\Check_Changes_Handler::check_changes_action_handler + * + * @return void */ public function test_check_changes_action_handler_no_post() { $_GET['post'] = '123'; @@ -192,6 +204,8 @@ public function test_check_changes_action_handler_no_post() { * @covers \Yoast\WP\Duplicate_Post\Handlers\Check_Changes_Handler::check_changes_action_handler * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_check_changes_action_handler_no_original() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); diff --git a/tests/Unit/Permissions_Helper_Test.php b/tests/Unit/Permissions_Helper_Test.php index e687289fe..c99ce3a46 100644 --- a/tests/Unit/Permissions_Helper_Test.php +++ b/tests/Unit/Permissions_Helper_Test.php @@ -23,6 +23,8 @@ final class Permissions_Helper_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -36,6 +38,8 @@ protected function set_up() { * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::get_enabled_post_types * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_get_enabled_post_types() { $post_types = [ 'post', 'page', 'book', 'movie ' ]; @@ -58,6 +62,8 @@ public function test_get_enabled_post_types() { * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::get_enabled_post_types * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_get_enabled_post_types_not_array() { $post_types = 'post'; @@ -78,6 +84,8 @@ public function test_get_enabled_post_types_not_array() { * Tests the is_post_type_enabled function. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::is_post_type_enabled + * + * @return void */ public function test_is_post_type_enabled() { $post_types = [ 'post', 'page', 'book', 'movie ' ]; @@ -95,6 +103,8 @@ public function test_is_post_type_enabled() { * Tests the is_current_user_allowed_to_copy function. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::is_current_user_allowed_to_copy + * + * @return void */ public function test_is_current_user_allowed_to_copy() { Monkey\Functions\expect( '\current_user_can' ) @@ -110,6 +120,8 @@ public function test_is_current_user_allowed_to_copy() { * Tests the successful is_rewrite_and_republish_copy function. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::is_rewrite_and_republish_copy + * + * @return void */ public function test_is_rewrite_and_republish_copy_successful() { $post = Mockery::mock( WP_Post::class ); @@ -126,6 +138,8 @@ public function test_is_rewrite_and_republish_copy_successful() { * Tests the unsuccessful is_rewrite_and_republish_copy function. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::is_rewrite_and_republish_copy + * + * @return void */ public function test_is_rewrite_and_republish_copy_unsuccessful() { $post = Mockery::mock( WP_Post::class ); @@ -142,6 +156,8 @@ public function test_is_rewrite_and_republish_copy_unsuccessful() { * Tests the successful has_rewrite_and_republish_copy function. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::has_rewrite_and_republish_copy + * + * @return void */ public function test_has_rewrite_and_republish_copy_successful() { $post = Mockery::mock( WP_Post::class ); @@ -158,6 +174,8 @@ public function test_has_rewrite_and_republish_copy_successful() { * Tests the unsuccessful has_rewrite_and_republish_copy function. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::has_rewrite_and_republish_copy + * + * @return void */ public function test_has_rewrite_and_republish_copy_unsuccessful() { $post = Mockery::mock( WP_Post::class ); @@ -174,6 +192,8 @@ public function test_has_rewrite_and_republish_copy_unsuccessful() { * Tests the successful has_scheduled_rewrite_and_republish_copy function. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::has_scheduled_rewrite_and_republish_copy + * + * @return void */ public function test_has_scheduled_rewrite_and_republish_copy_successful() { $post = Mockery::mock( WP_Post::class ); @@ -200,6 +220,8 @@ public function test_has_scheduled_rewrite_and_republish_copy_successful() { * Tests has_scheduled_rewrite_and_republish_copy function when post has no R&R copy. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::has_scheduled_rewrite_and_republish_copy + * + * @return void */ public function test_has_scheduled_rewrite_and_republish_copy_no_copy() { $post = Mockery::mock( WP_Post::class ); @@ -219,6 +241,8 @@ public function test_has_scheduled_rewrite_and_republish_copy_no_copy() { * Tests has_scheduled_rewrite_and_republish_copy function when the copy is not scheduled. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::has_scheduled_rewrite_and_republish_copy + * + * @return void */ public function test_has_scheduled_rewrite_and_republish_copy_not_scheduled() { $post = Mockery::mock( WP_Post::class ); @@ -244,8 +268,10 @@ public function test_has_scheduled_rewrite_and_republish_copy_not_scheduled() { * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::is_edit_post_screen * @dataProvider is_edit_post_screen_provider * - * @param mixed $original Input value. - * @param mixed $expected Expected output. + * @param array $original Input value. + * @param bool $expected Expected output. + * + * @return void */ public function test_is_edit_post_screen( $original, $expected ) { $screen = Mockery::mock( WP_Screen::class ); @@ -264,7 +290,7 @@ public function test_is_edit_post_screen( $original, $expected ) { /** * Data provider for test_is_edit_post_screen. * - * @return array The test parameters. + * @return array>> The test parameters. */ public static function is_edit_post_screen_provider() { return [ @@ -317,8 +343,10 @@ public static function is_edit_post_screen_provider() { * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::is_new_post_screen * @dataProvider is_new_post_screen_provider * - * @param mixed $original Input value. - * @param mixed $expected Expected output. + * @param array $original Input value. + * @param bool $expected Expected output. + * + * @return void */ public function test_is_new_post_screen( $original, $expected ) { $screen = Mockery::mock( WP_Screen::class ); @@ -337,7 +365,7 @@ public function test_is_new_post_screen( $original, $expected ) { /** * Data provider for test_is_new_post_screen. * - * @return array The test parameters. + * @return array>> The test parameters. */ public static function is_new_post_screen_provider() { return [ @@ -390,8 +418,10 @@ public static function is_new_post_screen_provider() { * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::is_classic_editor * @dataProvider is_classic_editor_provider * - * @param mixed $original Input value. - * @param mixed $expected Expected output. + * @param array $original Input value. + * @param bool $expected Expected output. + * + * @return void */ public function test_is_classic_editor( $original, $expected ) { $screen = Mockery::mock( WP_Screen::class ); @@ -414,7 +444,7 @@ public function test_is_classic_editor( $original, $expected ) { /** * Data provider for test_is_new_post_screen. * - * @return array The test parameters. + * @return array>> The test parameters. */ public static function is_classic_editor_provider() { return [ @@ -467,6 +497,8 @@ public static function is_classic_editor_provider() { * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::has_original_changed * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_has_original_changed_successful() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -498,6 +530,8 @@ public function test_has_original_changed_successful() { * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::has_original_changed * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_has_original_changed_no() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -527,6 +561,8 @@ public function test_has_original_changed_no() { * Tests the has_original_changed function when the post is not meant for Rewrite & Republish. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::has_original_changed + * + * @return void */ public function test_has_original_changed_not_rewrite_and_republish() { $post = Mockery::mock( WP_Post::class ); @@ -543,6 +579,8 @@ public function test_has_original_changed_not_rewrite_and_republish() { * Tests the should_links_be_displayed function. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::should_links_be_displayed + * + * @return void */ public function test_should_links_be_displayed_successful() { $post = Mockery::mock( WP_Post::class ); @@ -569,6 +607,8 @@ public function test_should_links_be_displayed_successful() { * Tests the should_links_be_displayed function when the user is not allowed to copy. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::should_links_be_displayed + * + * @return void */ public function test_should_links_be_displayed_unsuccessful_user_not_allowed_to_copy() { $post = Mockery::mock( WP_Post::class ); @@ -595,6 +635,8 @@ public function test_should_links_be_displayed_unsuccessful_user_not_allowed_to_ * Tests the should_links_be_displayed function when the post type is not enabled for copy. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::should_links_be_displayed + * + * @return void */ public function test_should_links_be_displayed_unsuccessful_post_type_not_enabled_for_copy() { $post = Mockery::mock( WP_Post::class ); @@ -621,6 +663,8 @@ public function test_should_links_be_displayed_unsuccessful_post_type_not_enable * Tests the should_links_be_displayed function when the post is a Rewrite & Republish copy. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::should_links_be_displayed + * + * @return void */ public function test_should_links_be_displayed_unsuccessful_post_is_rewrite_and_republish() { $post = Mockery::mock( WP_Post::class ); @@ -649,8 +693,10 @@ public function test_should_links_be_displayed_unsuccessful_post_is_rewrite_and_ * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::should_rewrite_and_republish_be_allowed * @dataProvider should_rewrite_and_republish_be_allowed_provider * - * @param mixed $original Input value. - * @param mixed $expected Expected output. + * @param array $original Input value. + * @param bool $expected Expected output. + * + * @return void */ public function test_should_rewrite_and_republish_be_allowed( $original, $expected ) { $post = Mockery::mock( WP_Post::class ); @@ -675,7 +721,7 @@ public function test_should_rewrite_and_republish_be_allowed( $original, $expect /** * Data provider for test_should_rewrite_and_republish_be_allowed. * - * @return array The test parameters. + * @return array>> The test parameters. */ public static function should_rewrite_and_republish_be_allowed_provider() { return [ @@ -728,8 +774,10 @@ public static function should_rewrite_and_republish_be_allowed_provider() { * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::post_type_has_admin_bar * @dataProvider post_type_has_admin_bar_provider * - * @param mixed $original Input value. - * @param mixed $expected Expected output. + * @param array $original Input value. + * @param bool $expected Expected output. + * + * @return void */ public function test_post_type_has_admin_bar( $original, $expected ) { $post_type = 'post'; @@ -747,7 +795,7 @@ public function test_post_type_has_admin_bar( $original, $expected ) { /** * Data provider for test_post_type_has_admin_bar. * - * @return array The test parameters. + * @return array>> The test parameters. */ public static function post_type_has_admin_bar_provider() { return [ @@ -786,6 +834,8 @@ public static function post_type_has_admin_bar_provider() { * Tests the post_type_has_admin_bar function when the post type does not exist. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::post_type_has_admin_bar + * + * @return void */ public function test_post_type_has_admin_bar_type_not_existing() { $post_type = 'apple'; @@ -804,8 +854,10 @@ public function test_post_type_has_admin_bar_type_not_existing() { * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::is_copy_allowed_to_be_republished * @dataProvider is_copy_allowed_to_be_republished_provider * - * @param mixed $post_status Input value. - * @param mixed $expected Expected output. + * @param string $post_status Input value. + * @param bool $expected Expected output. + * + * @return void */ public function test_is_copy_allowed_to_be_republished( $post_status, $expected ) { $post = Mockery::mock( WP_Post::class ); @@ -817,7 +869,7 @@ public function test_is_copy_allowed_to_be_republished( $post_status, $expected /** * Data provider for test_is_copy_allowed_to_be_republished. * - * @return array The test parameters. + * @return array> The test parameters. */ public static function is_copy_allowed_to_be_republished_provider() { return [ @@ -840,6 +892,8 @@ public static function is_copy_allowed_to_be_republished_provider() { * Tests the has_trashed_rewrite_and_republish_copy function when the post has a trashed Rewrite & Republisb copy. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::has_trashed_rewrite_and_republish_copy + * + * @return void */ public function test_has_trashed_rewrite_and_republish_copy() { $post = Mockery::mock( WP_Post::class ); @@ -863,6 +917,8 @@ public function test_has_trashed_rewrite_and_republish_copy() { * Tests the has_trashed_rewrite_and_republish_copy function when the post has a non-trashed Rewrite & Republisb copy. * * @covers \Yoast\WP\Duplicate_Post\Permissions_Helper::has_trashed_rewrite_and_republish_copy + * + * @return void */ public function test_does_not_have_trashed_rewrite_and_republish_copy() { $post = Mockery::mock( WP_Post::class ); diff --git a/tests/Unit/Post_Duplicator_Test.php b/tests/Unit/Post_Duplicator_Test.php index 3cb6c6a24..8cba2ccbd 100644 --- a/tests/Unit/Post_Duplicator_Test.php +++ b/tests/Unit/Post_Duplicator_Test.php @@ -22,6 +22,8 @@ final class Post_Duplicator_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -33,6 +35,8 @@ protected function set_up() { * Tests the get_default_options function. * * @covers \Yoast\WP\Duplicate_Post\Post_Duplicator::get_default_options + * + * @return void */ public function test_get_default_options() { $this->assertSame( @@ -70,8 +74,10 @@ public function test_get_default_options() { * @covers \Yoast\WP\Duplicate_Post\Post_Duplicator::generate_copy_title * @dataProvider generate_copy_title_provider * - * @param mixed $original Input value. - * @param mixed $expected Expected output. + * @param array $original Input value. + * @param string $expected Expected output. + * + * @return void */ public function test_generate_copy_title( $original, $expected ) { $post = Mockery::mock( WP_Post::class ); @@ -83,7 +89,7 @@ public function test_generate_copy_title( $original, $expected ) { /** * Data provider for test_generate_copy_title. * - * @return array + * @return array>> */ public static function generate_copy_title_provider() { $data = []; @@ -151,8 +157,10 @@ public static function generate_copy_title_provider() { * @covers \Yoast\WP\Duplicate_Post\Post_Duplicator::generate_copy_status * @dataProvider generate_copy_status_provider * - * @param mixed $original Input value. - * @param mixed $expected Expected output. + * @param array $original Input value. + * @param string $expected Expected output. + * + * @return void */ public function test_generate_copy_status( $original, $expected ) { $post = Mockery::mock( WP_Post::class ); @@ -184,7 +192,7 @@ static function ( $post_type ) { /** * Data provider for test_generate_copy_status. * - * @return array + * @return array>> */ public static function generate_copy_status_provider() { $data = []; @@ -248,8 +256,10 @@ public static function generate_copy_status_provider() { * @covers \Yoast\WP\Duplicate_Post\Post_Duplicator::generate_copy_author * @dataProvider generate_copy_author_provider * - * @param mixed $original Input value. - * @param mixed $expected Expected output. + * @param array $original Input value. + * @param int $expected Expected output. + * + * @return void */ public function test_generate_copy_author( $original, $expected ) { $post = Mockery::mock( WP_Post::class ); @@ -288,7 +298,7 @@ static function ( $post_type ) { /** * Data provider for test_generate_copy_author. * - * @return array + * @return array>> */ public static function generate_copy_author_provider() { $data = []; diff --git a/tests/Unit/Post_Republisher_Test.php b/tests/Unit/Post_Republisher_Test.php index 1d985a57c..fa1a49983 100644 --- a/tests/Unit/Post_Republisher_Test.php +++ b/tests/Unit/Post_Republisher_Test.php @@ -37,6 +37,8 @@ final class Post_Republisher_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -54,6 +56,8 @@ protected function set_up() { * Tests the constructor. * * @covers \Yoast\WP\Duplicate_Post\Post_Republisher::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -71,6 +75,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\Post_Republisher::register_hooks + * + * @return void */ public function test_register_hooks() { $enabled_post_types = [ 'post', 'page' ]; @@ -112,6 +118,8 @@ public function test_register_hooks() { * * @covers \Yoast\WP\Duplicate_Post\Post_Republisher::is_classic_editor_post_request * @runInSeparateProcess + * + * @return void */ public function test_is_classic_editor_post_request_when_rest_request() { \define( 'REST_REQUEST', true ); @@ -122,6 +130,8 @@ public function test_is_classic_editor_post_request_when_rest_request() { * Tests is_classic_editor_post_request when the request is the Block Editor POST request to save custom meta. * * @covers \Yoast\WP\Duplicate_Post\Post_Republisher::is_classic_editor_post_request + * + * @return void */ public function test_is_classic_editor_post_request_when_block_editor_saving_custom_meta_boxes() { $_GET['meta-box-loader'] = '1'; @@ -139,6 +149,8 @@ public function test_is_classic_editor_post_request_when_block_editor_saving_cus * Tests is_classic_editor_post_request when the request is the Classic Editor POST request. * * @covers \Yoast\WP\Duplicate_Post\Post_Republisher::is_classic_editor_post_request + * + * @return void */ public function test_is_classic_editor_post_request() { Monkey\Functions\expect( '\wp_doing_ajax' ) @@ -151,6 +163,8 @@ public function test_is_classic_editor_post_request() { * Tests register_post_statuses is called with expected arguments. * * @covers \Yoast\WP\Duplicate_Post\Post_Republisher::register_post_statuses + * + * @return void */ public function test_register_post_statuses() { $this->stubTranslationFunctions(); @@ -175,8 +189,10 @@ public function test_register_post_statuses() { * @covers \Yoast\WP\Duplicate_Post\Post_Republisher::change_post_copy_status * @dataProvider change_post_copy_status_provider * - * @param mixed $input Input values. - * @param mixed $expected Expected output. + * @param array $input Input values. + * @param array $expected Expected output. + * + * @return void */ public function test_change_post_copy_status( $input, $expected ) { $post = Mockery::mock( WP_Post::class ); @@ -201,7 +217,7 @@ public function test_change_post_copy_status( $input, $expected ) { /** * Data provider for test_change_post_copy_status. * - * @return array + * @return array>> */ public static function change_post_copy_status_provider() { return [ @@ -232,6 +248,8 @@ public static function change_post_copy_status_provider() { * @covers \Yoast\WP\Duplicate_Post\Post_Republisher::republish_scheduled_post * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_republish_scheduled_post() { $original = Mockery::mock( WP_Post::class ); @@ -268,6 +286,8 @@ public function test_republish_scheduled_post() { * Tests the republish_scheduled_post function when an invalid copy is passed. * * @covers \Yoast\WP\Duplicate_Post\Post_Republisher::republish_scheduled_post + * + * @return void */ public function test_republish_scheduled_post_invalid_copy() { $copy = Mockery::mock( WP_Post::class ); @@ -292,6 +312,8 @@ public function test_republish_scheduled_post_invalid_copy() { * @covers \Yoast\WP\Duplicate_Post\Post_Republisher::republish_scheduled_post * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_republish_scheduled_post_original_deleted() { $copy = Mockery::mock( WP_Post::class ); diff --git a/tests/Unit/Revisions_Migrator_Test.php b/tests/Unit/Revisions_Migrator_Test.php index d1c0a4721..6f5960d54 100644 --- a/tests/Unit/Revisions_Migrator_Test.php +++ b/tests/Unit/Revisions_Migrator_Test.php @@ -21,6 +21,8 @@ final class Revisions_Migrator_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -32,6 +34,8 @@ protected function set_up() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\Revisions_Migrator::register_hooks + * + * @return void */ public function test_register_hooks() { Monkey\Actions\expectAdded( 'duplicate_post_after_rewriting' ) @@ -44,6 +48,8 @@ public function test_register_hooks() { * Tests the migrate_revisions function with unlimited revisions allowed * * @covers \Yoast\WP\Duplicate_Post\Revisions_Migrator::migrate_revisions + * + * @return void */ public function test_migrate_revisions_unlimited() { $post_id = 128; @@ -86,6 +92,8 @@ public function test_migrate_revisions_unlimited() { * Tests the migrate_revisions function with limited revisions allowed * * @covers \Yoast\WP\Duplicate_Post\Revisions_Migrator::migrate_revisions + * + * @return void */ public function test_migrate_revisions_limited() { $post_id = 128; @@ -142,6 +150,8 @@ public function test_migrate_revisions_limited() { * Tests the migrate_revisions function with no revisions allowed * * @covers \Yoast\WP\Duplicate_Post\Revisions_Migrator::migrate_revisions + * + * @return void */ public function test_migrate_revisions_none() { $post_id = 128; diff --git a/tests/Unit/UI/Admin_Bar_Test.php b/tests/Unit/UI/Admin_Bar_Test.php index bb31aa123..fb3d09d47 100644 --- a/tests/Unit/UI/Admin_Bar_Test.php +++ b/tests/Unit/UI/Admin_Bar_Test.php @@ -49,6 +49,8 @@ final class Admin_Bar_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -71,6 +73,8 @@ protected function set_up() { * Tests if the needed attributes are set correctly. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -95,6 +99,8 @@ public function test_constructor() { * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::register_hooks * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_register_hooks() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -117,6 +123,8 @@ public function test_register_hooks() { * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::admin_bar_render * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_admin_bar_render_successful_both() { $this->stubTranslationFunctions(); @@ -175,6 +183,8 @@ public function test_admin_bar_render_successful_both() { * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::admin_bar_render * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_admin_bar_render_successful_one() { $this->stubTranslationFunctions(); @@ -226,6 +236,8 @@ public function test_admin_bar_render_successful_one() { * Tests the admin_bar_render function when the admin bar is not showing. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::admin_bar_render + * + * @return void */ public function test_admin_bar_render_unsuccessful_no_admin_bar() { global $wp_admin_bar; @@ -265,6 +277,8 @@ public function test_admin_bar_render_unsuccessful_no_admin_bar() { * Tests the admin_bar_render function when no post is not showing. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::admin_bar_render + * + * @return void */ public function test_admin_bar_render_unsuccessful_no_post() { global $wp_admin_bar; @@ -303,6 +317,8 @@ public function test_admin_bar_render_unsuccessful_no_post() { * Tests the enqueue_styles function when the style is enqueued. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::enqueue_styles + * + * @return void */ public function test_enqueue_styles_successful() { $post = Mockery::mock( WP_Post::class ); @@ -323,6 +339,8 @@ public function test_enqueue_styles_successful() { * Tests the enqueue_styles function when the admin bar is not showing. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::enqueue_styles + * + * @return void */ public function test_enqueue_styles_unsuccessful_no_admin_bar() { $post = Mockery::mock( WP_Post::class ); @@ -345,6 +363,8 @@ public function test_enqueue_styles_unsuccessful_no_admin_bar() { * Tests the enqueue_styles function when no post is not showing. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::enqueue_styles + * + * @return void */ public function test_enqueue_styles_unsuccessful_no_post() { $post = Mockery::mock( WP_Post::class ); @@ -366,6 +386,8 @@ public function test_enqueue_styles_unsuccessful_no_post() { * Tests the get_current_post function when a post is returned in the backend. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::get_current_post + * + * @return void */ public function test_get_current_post_successful_backend() { global $wp_the_query; @@ -406,6 +428,8 @@ public function test_get_current_post_successful_backend() { * Tests the get_current_post function when a post is returned in the frontend. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::get_current_post + * + * @return void */ public function test_get_current_post_successful_frontend() { global $wp_the_query; @@ -447,6 +471,8 @@ public function test_get_current_post_successful_frontend() { * Tests the get_current_post function when no post is returned in the backend. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::get_current_post + * + * @return void */ public function test_get_current_post_unsuccessful_backend() { global $wp_the_query; @@ -487,6 +513,8 @@ public function test_get_current_post_unsuccessful_backend() { * Tests the get_current_post function when a non-post is returned in the frontend. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::get_current_post + * + * @return void */ public function test_get_current_post_unsuccessful_frontend() { global $wp_the_query; @@ -537,6 +565,8 @@ public function test_get_current_post_unsuccessful_frontend() { * Tests the get_current_post function when the link should not be displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Admin_Bar::get_current_post + * + * @return void */ public function test_get_current_post_unsuccessful_should_not_be_displayed() { global $wp_the_query; diff --git a/tests/Unit/UI/Asset_Manager_Test.php b/tests/Unit/UI/Asset_Manager_Test.php index d83179e89..cf8869c0e 100644 --- a/tests/Unit/UI/Asset_Manager_Test.php +++ b/tests/Unit/UI/Asset_Manager_Test.php @@ -21,6 +21,8 @@ final class Asset_Manager_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -32,6 +34,8 @@ protected function set_up() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\UI\Asset_Manager::register_hooks + * + * @return void */ public function test_register_hooks() { $this->instance->register_hooks(); @@ -44,6 +48,8 @@ public function test_register_hooks() { * Tests the register_styles function. * * @covers \Yoast\WP\Duplicate_Post\UI\Asset_Manager::register_styles + * + * @return void */ public function test_register_styles() { $styles_url = 'http://basic.wordpress.test/wp-content/plugins/duplicate-post/css/duplicate-post.css'; @@ -78,6 +84,8 @@ public function test_register_styles() { * @covers \Yoast\WP\Duplicate_Post\UI\Asset_Manager::register_scripts * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_register_scripts() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -145,6 +153,8 @@ public function test_register_scripts() { * Tests the enqueue_styles function. * * @covers \Yoast\WP\Duplicate_Post\UI\Asset_Manager::enqueue_styles + * + * @return void */ public function test_enqueue_styles() { Monkey\Functions\expect( '\wp_enqueue_style' ) @@ -157,6 +167,8 @@ public function test_enqueue_styles() { * Tests the enqueue_edit_script function. * * @covers \Yoast\WP\Duplicate_Post\UI\Asset_Manager::enqueue_edit_script + * + * @return void */ public function test_enqueue_edit_script() { Monkey\Functions\expect( '\wp_enqueue_script' ) @@ -175,6 +187,8 @@ public function test_enqueue_edit_script() { * Tests the enqueue_strings_script function. * * @covers \Yoast\WP\Duplicate_Post\UI\Asset_Manager::enqueue_strings_script + * + * @return void */ public function test_enqueue_strings_script() { Monkey\Functions\expect( '\wp_enqueue_script' ) @@ -190,6 +204,8 @@ public function test_enqueue_strings_script() { * Tests the enqueue_quick_edit_script function. * * @covers \Yoast\WP\Duplicate_Post\UI\Asset_Manager::enqueue_quick_edit_script + * + * @return void */ public function test_enqueue_quick_edit_script() { Monkey\Functions\expect( '\wp_enqueue_script' ) diff --git a/tests/Unit/UI/Block_Editor_Test.php b/tests/Unit/UI/Block_Editor_Test.php index 2616af237..29cb37cb3 100644 --- a/tests/Unit/UI/Block_Editor_Test.php +++ b/tests/Unit/UI/Block_Editor_Test.php @@ -46,6 +46,8 @@ final class Block_Editor_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -68,6 +70,8 @@ protected function set_up() { * Tests if the needed attributes are set correctly. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -85,6 +89,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::register_hooks + * + * @return void */ public function test_register_hooks() { $this->instance->register_hooks(); @@ -151,8 +157,10 @@ public function test_register_hooks() { * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::should_previously_used_keyword_assessment_run * @dataProvider should_previously_used_keyword_assessment_run_provider * - * @param mixed $original Input value. - * @param mixed $expected Expected output. + * @param array $original Input value. + * @param bool $expected Expected output. + * + * @return void */ public function test_should_previously_used_keyword_assessment_run( $original, $expected ) { $post = Mockery::mock( WP_Post::class ); @@ -185,7 +193,7 @@ public function test_should_previously_used_keyword_assessment_run( $original, $ /** * Data provider for test_is_edit_post_screen. * - * @return array The test parameters. + * @return array>> The test parameters. */ public static function should_previously_used_keyword_assessment_run_provider() { return [ @@ -253,6 +261,8 @@ public static function should_previously_used_keyword_assessment_run_provider() * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::enqueue_block_editor_scripts * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_enqueue_block_editor_scripts() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -339,6 +349,8 @@ public function test_enqueue_block_editor_scripts() { * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::enqueue_block_editor_scripts * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_get_enqueue_block_editor_scripts_rewrite_and_republish() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -427,6 +439,8 @@ public function test_get_enqueue_block_editor_scripts_rewrite_and_republish() { * Tests the enqueueing of the scripts when no post is displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::enqueue_block_editor_scripts + * + * @return void */ public function test_enqueue_block_editor_scripts_no_post() { $this->permissions_helper @@ -451,6 +465,8 @@ public function test_enqueue_block_editor_scripts_no_post() { * Tests the enqueueing of the scripts when no post is displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::enqueue_block_editor_scripts + * + * @return void */ public function test_enqueue_block_editor_scripts_not_editor() { $this->permissions_helper @@ -476,6 +492,8 @@ public function test_enqueue_block_editor_scripts_not_editor() { * Tests the get_new_draft_permalink function when a link is returned. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_new_draft_permalink + * + * @return void */ public function test_get_new_draft_permalink_successful() { $post = Mockery::mock( WP_Post::class ); @@ -502,6 +520,8 @@ public function test_get_new_draft_permalink_successful() { * displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_new_draft_permalink + * + * @return void */ public function test_get_new_draft_permalink_unsuccessful() { $post = Mockery::mock( WP_Post::class ); @@ -527,6 +547,8 @@ public function test_get_new_draft_permalink_unsuccessful() { * returned. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_rewrite_republish_permalink + * + * @return void */ public function test_get_rewrite_republish_permalink_successful() { $post = Mockery::mock( WP_Post::class ); @@ -562,6 +584,8 @@ public function test_get_rewrite_republish_permalink_successful() { * Tests the get_rewrite_republish_permalink function when the post is a Rewrite & Republish copy. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_rewrite_republish_permalink + * + * @return void */ public function test_get_rewrite_republish_permalink_unsuccessful_is_rewrite_and_republish() { $post = Mockery::mock( WP_Post::class ); @@ -597,6 +621,8 @@ public function test_get_rewrite_republish_permalink_unsuccessful_is_rewrite_and * Tests the get_rewrite_republish_permalink function when the post has a Rewrite & Republish copy. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_rewrite_republish_permalink + * + * @return void */ public function test_get_rewrite_republish_permalink_unsuccessful_has_a_rewrite_and_republish() { $post = Mockery::mock( WP_Post::class ); @@ -631,6 +657,8 @@ public function test_get_rewrite_republish_permalink_unsuccessful_has_a_rewrite_ * Tests the get_rewrite_republish_permalink function when the links should not be displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_rewrite_republish_permalink + * + * @return void */ public function test_get_rewrite_republish_permalink_unsuccessful_links_should_not_be_displayed() { $post = Mockery::mock( WP_Post::class ); @@ -666,6 +694,8 @@ public function test_get_rewrite_republish_permalink_unsuccessful_links_should_n * Tests the get_check_permalink function when a link is returned. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_check_permalink + * + * @return void */ public function test_get_check_permalink_successful() { $post = Mockery::mock( WP_Post::class ); @@ -692,6 +722,8 @@ public function test_get_check_permalink_successful() { * Rewrite & Republish. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_check_permalink + * + * @return void */ public function test_get_check_permalink_not_rewrite_and_republish() { $post = Mockery::mock( WP_Post::class ); @@ -718,6 +750,8 @@ public function test_get_check_permalink_not_rewrite_and_republish() { * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_original_post_edit_url * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_get_original_post_edit_url_successful() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -773,6 +807,8 @@ static function ( $arguments, $query_string ) { * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_original_post_edit_url * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_get_original_post_edit_url_not_rewrite_and_republish() { $post = Mockery::mock( WP_Post::class ); @@ -796,6 +832,8 @@ public function test_get_original_post_edit_url_not_rewrite_and_republish() { * Tests the get_original_post_edit_url when there is no post. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_original_post_edit_url + * + * @return void */ public function test_get_original_post_edit_url_no_post() { Monkey\Functions\expect( '\get_post' ) @@ -813,6 +851,8 @@ public function test_get_original_post_edit_url_no_post() { * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::get_original_post_edit_url * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_get_original_post_edit_url_no_original() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -843,6 +883,8 @@ public function test_get_original_post_edit_url_no_original() { * Tests the hiding of the Elementor post status field. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::hide_elementor_post_status + * + * @return void */ public function test_hide_elementor_post_status() { $post = Mockery::mock( WP_Post::class ); @@ -869,6 +911,8 @@ public function test_hide_elementor_post_status() { * Tests the hiding of the Elementor post status field doesn't trigger on normal posts. * * @covers \Yoast\WP\Duplicate_Post\UI\Block_Editor::hide_elementor_post_status + * + * @return void */ public function test_dont_remove_elementor_post_status() { $post = Mockery::mock( WP_Post::class ); diff --git a/tests/Unit/UI/Bulk_Actions_Test.php b/tests/Unit/UI/Bulk_Actions_Test.php index 051518987..7ac5bc340 100644 --- a/tests/Unit/UI/Bulk_Actions_Test.php +++ b/tests/Unit/UI/Bulk_Actions_Test.php @@ -29,6 +29,8 @@ final class Bulk_Actions_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -41,6 +43,8 @@ protected function set_up() { * Tests if the needed attributes are set correctly. * * @covers \Yoast\WP\Duplicate_Post\UI\Bulk_Actions::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -55,6 +59,8 @@ public function test_constructor() { * @covers \Yoast\WP\Duplicate_Post\UI\Bulk_Actions::register_hooks * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_register_hooks() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -73,6 +79,8 @@ public function test_register_hooks() { * Tests the add_bulk_filters function when a filter is added. * * @covers \Yoast\WP\Duplicate_Post\UI\Bulk_Actions::add_bulk_filters + * + * @return void */ public function test_add_bulk_filters_successful() { $duplicate_post_types_enabled = [ 'post', 'page' ]; @@ -92,6 +100,8 @@ public function test_add_bulk_filters_successful() { * Tests the add_bulk_filters function when the user is not allowed to copy. * * @covers \Yoast\WP\Duplicate_Post\UI\Bulk_Actions::add_bulk_filters + * + * @return void */ public function test_add_bulk_filters_unsuccessful_user_not_allowed() { Monkey\Functions\expect( '\get_option' ) @@ -115,6 +125,8 @@ public function test_add_bulk_filters_unsuccessful_user_not_allowed() { * Tests the add_bulk_filters function when no post types are enabled. * * @covers \Yoast\WP\Duplicate_Post\UI\Bulk_Actions::add_bulk_filters + * + * @return void */ public function test_add_bulk_filters_unsuccessful_no_enabled_post_types() { $duplicate_post_types_enabled = []; @@ -140,6 +152,8 @@ public function test_add_bulk_filters_unsuccessful_no_enabled_post_types() { * @covers \Yoast\WP\Duplicate_Post\UI\Bulk_Actions::register_bulk_action * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_register_bulk_action() { $this->stubTranslationFunctions(); diff --git a/tests/Unit/UI/Classic_Editor_Test.php b/tests/Unit/UI/Classic_Editor_Test.php index 11bf55494..13aedfea6 100644 --- a/tests/Unit/UI/Classic_Editor_Test.php +++ b/tests/Unit/UI/Classic_Editor_Test.php @@ -46,6 +46,8 @@ final class Classic_Editor_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -68,6 +70,8 @@ protected function set_up() { * Tests if the needed attributes are set correctly. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -87,6 +91,8 @@ public function test_constructor() { * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::register_hooks * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_register_hooks() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -126,6 +132,8 @@ public function test_register_hooks() { * Tests the registration of the translation hooks. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::hook_translations + * + * @return void */ public function test_hook_translations() { $this->instance->hook_translations(); @@ -138,6 +146,8 @@ public function test_hook_translations() { * Tests the successful enqueue_classic_editor_scripts function. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::enqueue_classic_editor_scripts + * + * @return void */ public function test_enqueue_classic_editor_scripts() { $_GET['post'] = '123'; @@ -168,6 +178,8 @@ public function test_enqueue_classic_editor_scripts() { * Tests the successful enqueue_classic_editor_styles function. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::enqueue_classic_editor_styles + * + * @return void */ public function test_enqueue_classic_editor_styles() { $_GET['post'] = '123'; @@ -197,6 +209,8 @@ public function test_enqueue_classic_editor_styles() { * Tests the add_new_draft_post_button function when a button is displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::add_new_draft_post_button + * + * @return void */ public function test_add_new_draft_post_button_successful() { $this->stubEscapeFunctions(); @@ -235,6 +249,8 @@ public function test_add_new_draft_post_button_successful() { * Tests the add_new_draft_post_button function when a button is displayed and the post ID comes from $_GET. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::add_new_draft_post_button + * + * @return void */ public function test_add_new_draft_post_button_successful_post_from_GET() { $this->stubEscapeFunctions(); @@ -277,6 +293,8 @@ public function test_add_new_draft_post_button_successful_post_from_GET() { * Tests the add_new_draft_post_button function when no post could be retrieved. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::add_new_draft_post_button + * + * @return void */ public function test_add_new_draft_post_button_unsuccessful_no_post() { Monkey\Functions\expect( '\get_option' ) @@ -302,6 +320,8 @@ public function test_add_new_draft_post_button_unsuccessful_no_post() { * Tests the add_new_draft_post_button function when the link cannot be displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::add_new_draft_post_button + * + * @return void */ public function test_add_new_draft_post_button_unsuccessful_no_link_allowed() { $post = Mockery::mock( WP_Post::class ); @@ -331,6 +351,8 @@ public function test_add_new_draft_post_button_unsuccessful_no_link_allowed() { * Tests the add_rewrite_and_republish_post_button function when a button is displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::add_rewrite_and_republish_post_button + * + * @return void */ public function test_add_rewrite_and_republish_post_button_successful() { $this->stubEscapeFunctions(); @@ -375,6 +397,8 @@ public function test_add_rewrite_and_republish_post_button_successful() { * Tests the add_rewrite_and_republish_post_button function when a button is displayed and the post ID comes from $_GET. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::add_rewrite_and_republish_post_button + * + * @return void */ public function test_add_rewrite_and_republish_post_button_post_from_GET() { $this->stubEscapeFunctions(); @@ -423,6 +447,8 @@ public function test_add_rewrite_and_republish_post_button_post_from_GET() { * Tests the add_rewrite_and_republish_post_button function when no post could be retrieved. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::add_rewrite_and_republish_post_button + * + * @return void */ public function test_add_rewrite_and_republish_post_button_no_post() { Monkey\Functions\expect( '\get_option' ) @@ -448,6 +474,8 @@ public function test_add_rewrite_and_republish_post_button_no_post() { * Tests the add_rewrite_and_republish_post_button function when the link cannot be displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::add_rewrite_and_republish_post_button + * + * @return void */ public function test_add_rewrite_and_republish_post_button_unsuccessful_is_for_rewrite_and_republish() { $post = Mockery::mock( WP_Post::class ); @@ -483,6 +511,8 @@ public function test_add_rewrite_and_republish_post_button_unsuccessful_is_for_r * Tests the add_rewrite_and_republish_post_button function when the post is not published. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::add_rewrite_and_republish_post_button + * + * @return void */ public function test_add_rewrite_and_republish_post_button_not_publish() { $post = Mockery::mock( WP_Post::class ); @@ -512,6 +542,8 @@ public function test_add_rewrite_and_republish_post_button_not_publish() { * Tests the change_republish_strings_classic_editor function when the copy should be changed in the case of the date label. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_republish_strings_classic_editor + * + * @return void */ public function test_should_change_republish_strings_date_label() { $this->stubTranslationFunctions(); @@ -538,6 +570,8 @@ public function test_should_change_republish_strings_date_label() { * Tests the change_republish_strings_classic_editor function when the copy should be changed. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_republish_strings_classic_editor + * + * @return void */ public function test_should_change_republish_strings() { $this->stubTranslationFunctions(); @@ -564,6 +598,8 @@ public function test_should_change_republish_strings() { * Tests the change_republish_strings_classic_editor function when the copy should not be changed. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_republish_strings_classic_editor + * + * @return void */ public function test_should_not_change_republish_strings() { $text = 'Publish'; @@ -590,6 +626,8 @@ public function test_should_not_change_republish_strings() { * because the copy is not 'Publish'. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_republish_strings_classic_editor + * + * @return void */ public function test_should_not_change_republish_strings_other_text() { $text = 'Test'; @@ -614,6 +652,8 @@ public function test_should_not_change_republish_strings_other_text() { * because the domain is not 'default'. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_republish_strings_classic_editor + * + * @return void */ public function test_should_not_change_republish_strings_other_domain() { $text = 'Publish'; @@ -637,6 +677,8 @@ public function test_should_not_change_republish_strings_other_domain() { * Tests the change_schedule_strings_classic_editor function when the copy should be changed. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_schedule_strings_classic_editor + * + * @return void */ public function test_should_change_schedule_strings() { $this->stubTranslationFunctions(); @@ -664,6 +706,8 @@ public function test_should_change_schedule_strings() { * Tests the change_schedule_strings_classic_editor function when the copy should not be changed. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_schedule_strings_classic_editor + * + * @return void */ public function test_should_not_change_schedule_strings() { $text = 'Schedule'; @@ -691,6 +735,8 @@ public function test_should_not_change_schedule_strings() { * because the copy is not 'Schedule'. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_schedule_strings_classic_editor + * + * @return void */ public function test_should_not_change_schedule_strings_other_text() { $text = 'Test'; @@ -716,6 +762,8 @@ public function test_should_not_change_schedule_strings_other_text() { * because the domain is not 'default'. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_schedule_strings_classic_editor + * + * @return void */ public function test_should_not_change_schedule_strings_other_domain() { $text = 'Schedule'; @@ -741,6 +789,8 @@ public function test_should_not_change_schedule_strings_other_domain() { * because the context is not 'default'. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_schedule_strings_classic_editor + * + * @return void */ public function test_should_not_change_schedule_strings_other_context() { $text = 'Schedule'; @@ -765,6 +815,8 @@ public function test_should_not_change_schedule_strings_other_context() { * Tests the change_scheduled_notice_classic_editor function when the copy should be changed for a post. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_scheduled_notice_classic_editor + * + * @return void */ public function test_should_change_scheduled_notice_post() { $this->stubTranslationFunctions(); @@ -879,6 +931,8 @@ public function test_should_change_scheduled_notice_post() { * Tests the change_scheduled_notice_classic_editor function when the copy should be changed for a page. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::change_scheduled_notice_classic_editor + * + * @return void */ public function test_should_change_scheduled_notice_page() { $this->stubTranslationFunctions(); @@ -993,6 +1047,8 @@ public function test_should_change_scheduled_notice_page() { * Tests the should_change_rewrite_republish_copy function when it should return true for a post. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::should_change_rewrite_republish_copy + * + * @return void */ public function test_should_change_rewrite_republish_copy_post() { global $pagenow; @@ -1016,6 +1072,8 @@ public function test_should_change_rewrite_republish_copy_post() { * Tests the should_change_rewrite_republish_copy function when it should return true for a new post. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::should_change_rewrite_republish_copy + * + * @return void */ public function test_should_change_rewrite_republish_copy_new_post() { global $pagenow; @@ -1040,6 +1098,8 @@ public function test_should_change_rewrite_republish_copy_new_post() { * because the current page is not a post edit screen. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::should_change_rewrite_republish_copy + * + * @return void */ public function test_should_not_change_rewrite_republish_copy_not_post_edit_screen() { global $pagenow; @@ -1059,6 +1119,8 @@ public function test_should_not_change_rewrite_republish_copy_not_post_edit_scre * because the current post is null. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::should_change_rewrite_republish_copy + * + * @return void */ public function test_should_not_change_rewrite_republish_copy_post_is_null() { global $pagenow; @@ -1075,6 +1137,8 @@ public function test_should_not_change_rewrite_republish_copy_post_is_null() { * because the current post is not a Rewrite & Republish post. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::should_change_rewrite_republish_copy + * + * @return void */ public function test_should_not_change_rewrite_republish_copy_not_republish_copy() { global $pagenow; @@ -1098,6 +1162,8 @@ public function test_should_not_change_rewrite_republish_copy_not_republish_copy * Tests the remove_slug_meta_box function when the post is a Rewrite & Republish copy. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::remove_slug_meta_box + * + * @return void */ public function test_remove_slug_meta_box() { $post = Mockery::mock( WP_Post::class ); @@ -1119,6 +1185,8 @@ public function test_remove_slug_meta_box() { * Tests the remove_slug_meta_box function when the post is not a Rewrite & Republish copy. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::remove_slug_meta_box + * + * @return void */ public function test_remove_slug_meta_box_not_rewrite_and_republish_copy() { $post = Mockery::mock( WP_Post::class ); @@ -1139,6 +1207,8 @@ public function test_remove_slug_meta_box_not_rewrite_and_republish_copy() { * Tests the remove_sample_permalink_slug_editor function when the post is a Rewrite & Republish copy. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::remove_sample_permalink_slug_editor + * + * @return void */ public function test_remove_sample_permalink_slug_editor() { $return = 'sample-permalink-html'; @@ -1160,6 +1230,8 @@ public function test_remove_sample_permalink_slug_editor() { * Tests the remove_sample_permalink_slug_editor function when the post is not a Rewrite & Republish copy. * * @covers \Yoast\WP\Duplicate_Post\UI\Classic_Editor::remove_sample_permalink_slug_editor + * + * @return void */ public function test_remove_sample_permalink_slug_editor_not_rewrite_and_republish_copy() { $return = 'sample-permalink-html'; diff --git a/tests/Unit/UI/Column_Test.php b/tests/Unit/UI/Column_Test.php index c987488c8..eddf59e62 100644 --- a/tests/Unit/UI/Column_Test.php +++ b/tests/Unit/UI/Column_Test.php @@ -37,6 +37,8 @@ final class Column_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -51,6 +53,8 @@ protected function set_up() { * Tests if the needed attributes are set correctly. * * @covers \Yoast\WP\Duplicate_Post\UI\Column::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -68,6 +72,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\UI\Column::register_hooks + * + * @return void */ public function test_register_hooks() { $enabled_post_types = [ 'post', 'page' ]; @@ -96,6 +102,8 @@ public function test_register_hooks() { * Tests the add_original_column function. * * @covers \Yoast\WP\Duplicate_Post\UI\Column::add_original_column + * + * @return void */ public function test_add_original_column_action() { $this->stubTranslationFunctions(); diff --git a/tests/Unit/UI/Link_Builder_Test.php b/tests/Unit/UI/Link_Builder_Test.php index 5e98b6052..1cab4eeab 100644 --- a/tests/Unit/UI/Link_Builder_Test.php +++ b/tests/Unit/UI/Link_Builder_Test.php @@ -22,6 +22,8 @@ final class Link_Builder_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -33,6 +35,8 @@ protected function set_up() { * Tests the build_rewrite_and_republish_link function. * * @covers \Yoast\WP\Duplicate_Post\UI\Link_Builder::build_rewrite_and_republish_link + * + * @return void */ public function test_build_rewrite_and_republish_link() { $post = Mockery::mock( WP_Post::class ); @@ -54,6 +58,8 @@ public function test_build_rewrite_and_republish_link() { * Tests the build_clone_link function. * * @covers \Yoast\WP\Duplicate_Post\UI\Link_Builder::build_clone_link + * + * @return void */ public function test_build_clone_link() { $post = Mockery::mock( WP_Post::class ); @@ -75,6 +81,8 @@ public function test_build_clone_link() { * Tests the build_new_draft_link function. * * @covers \Yoast\WP\Duplicate_Post\UI\Link_Builder::build_new_draft_link + * + * @return void */ public function test_build_new_draft_link() { $post = Mockery::mock( WP_Post::class ); @@ -96,6 +104,8 @@ public function test_build_new_draft_link() { * Tests the build_check_link function. * * @covers \Yoast\WP\Duplicate_Post\UI\Link_Builder::build_check_link + * + * @return void */ public function test_build_check_link() { $post = Mockery::mock( WP_Post::class ); @@ -117,6 +127,8 @@ public function test_build_check_link() { * Tests the build_link function. * * @covers \Yoast\WP\Duplicate_Post\UI\Link_Builder::build_link + * + * @return void */ public function test_build_link() { $post = Mockery::mock( WP_Post::class ); @@ -148,6 +160,8 @@ static function ( $query_string ) { * Tests the build_link function when context is not 'display'. * * @covers \Yoast\WP\Duplicate_Post\UI\Link_Builder::build_link + * + * @return void */ public function test_build_link_not_display() { $post = Mockery::mock( WP_Post::class ); @@ -179,6 +193,8 @@ static function ( $query_string ) { * Tests the build_link function with no valid post. * * @covers \Yoast\WP\Duplicate_Post\UI\Link_Builder::build_link + * + * @return void */ public function test_build_link_no_post() { $post = null; diff --git a/tests/Unit/UI/Metabox_Test.php b/tests/Unit/UI/Metabox_Test.php index 48c650603..5fe754667 100644 --- a/tests/Unit/UI/Metabox_Test.php +++ b/tests/Unit/UI/Metabox_Test.php @@ -30,6 +30,8 @@ final class Metabox_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -46,6 +48,8 @@ protected function set_up() { * Tests if the needed attributes are set correctly. * * @covers \Yoast\WP\Duplicate_Post\UI\Metabox::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -58,6 +62,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\UI\Metabox::register_hooks + * + * @return void */ public function test_register_hooks() { Monkey\Functions\expect( '\get_option' ) @@ -75,6 +81,8 @@ public function test_register_hooks() { * @covers \Yoast\WP\Duplicate_Post\UI\Metabox::add_custom_metabox * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_add_custom_metabox() { $this->stubTranslationFunctions(); @@ -111,6 +119,8 @@ public function test_add_custom_metabox() { * @covers \Yoast\WP\Duplicate_Post\UI\Metabox::add_custom_metabox * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_add_custom_metabox_post_type_not_enabled() { $enabled_post_types = [ 'post' ]; @@ -132,6 +142,8 @@ public function test_add_custom_metabox_post_type_not_enabled() { * @covers \Yoast\WP\Duplicate_Post\UI\Metabox::add_custom_metabox * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_add_custom_metabox_not_copy() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); diff --git a/tests/Unit/UI/Post_States_Test.php b/tests/Unit/UI/Post_States_Test.php index d90a83e6b..09d4d67fb 100644 --- a/tests/Unit/UI/Post_States_Test.php +++ b/tests/Unit/UI/Post_States_Test.php @@ -30,6 +30,8 @@ final class Post_States_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -43,6 +45,8 @@ protected function set_up() { * Tests the constructor. * * @covers \Yoast\WP\Duplicate_Post\UI\Post_States::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -55,6 +59,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\UI\Post_States::register_hooks + * + * @return void */ public function test_register_hooks() { $this->instance->register_hooks(); @@ -68,6 +74,8 @@ public function test_register_hooks() { * @covers \Yoast\WP\Duplicate_Post\UI\Post_States::show_original_in_post_states * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_show_original_in_post_states_successful() { $this->stubTranslationFunctions(); @@ -111,6 +119,8 @@ public function test_show_original_in_post_states_successful() { * @covers \Yoast\WP\Duplicate_Post\UI\Post_States::show_original_in_post_states * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_show_original_in_post_states_unsuccessful() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -148,6 +158,8 @@ public function test_show_original_in_post_states_unsuccessful() { * @covers \Yoast\WP\Duplicate_Post\UI\Post_States::show_original_in_post_states * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_show_original_in_rewrite_republish_post_successful() { $this->stubTranslationFunctions(); @@ -191,6 +203,8 @@ public function test_show_original_in_rewrite_republish_post_successful() { * @covers \Yoast\WP\Duplicate_Post\UI\Post_States::show_original_in_post_states * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_show_original_in_rewrite_republish_post_unsuccessful() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); diff --git a/tests/Unit/UI/Row_Actions_Test.php b/tests/Unit/UI/Row_Actions_Test.php index 740183769..2ed1d03c2 100644 --- a/tests/Unit/UI/Row_Actions_Test.php +++ b/tests/Unit/UI/Row_Actions_Test.php @@ -38,6 +38,8 @@ final class Row_Actions_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -53,6 +55,8 @@ protected function set_up() { * Tests if the needed attributes are set correctly. * * @covers \Yoast\WP\Duplicate_Post\UI\Row_Actions::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -72,6 +76,8 @@ public function test_constructor() { * @covers \Yoast\WP\Duplicate_Post\UI\Row_Actions::register_hooks * @runInSeparateProcess * @preserveGlobalState disabled + * + * @return void */ public function test_register_hooks() { $utils = Mockery::mock( 'alias:\Yoast\WP\Duplicate_Post\Utils' ); @@ -110,6 +116,8 @@ public function test_register_hooks() { * Tests the add_clone_action_link function when the links is displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Row_Actions::add_clone_action_link + * + * @return void */ public function test_add_clone_action_link_successful() { $this->stubEscapeFunctions(); @@ -161,6 +169,8 @@ static function ( $post ) { * Tests the add_clone_action_link function when the link should not be displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Row_Actions::add_clone_action_link + * + * @return void */ public function test_add_clone_action_link_unsuccessful() { $actions = [ @@ -198,6 +208,8 @@ public function test_add_clone_action_link_unsuccessful() { * Tests the add_new_draft_action_link function when the links is displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Row_Actions::add_new_draft_action_link + * + * @return void */ public function test_add_new_draft_action_link_successful() { $this->stubEscapeFunctions(); @@ -249,6 +261,8 @@ static function ( $post ) { * Tests the add_new_draft_action_link function when the link should not be displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Row_Actions::add_new_draft_action_link + * + * @return void */ public function test_add_new_draft_action_link_unsuccessful() { $actions = [ @@ -286,6 +300,8 @@ public function test_add_new_draft_action_link_unsuccessful() { * Tests the add_rewrite_and_republish_action_link function when the links is displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Row_Actions::add_rewrite_and_republish_action_link + * + * @return void */ public function test_add_rewrite_and_republish_action_link_successful() { $this->stubEscapeFunctions(); @@ -343,6 +359,8 @@ static function ( $post ) { * Tests the add_rewrite_and_republish_action_link function when the link should not be displayed. * * @covers \Yoast\WP\Duplicate_Post\UI\Row_Actions::add_rewrite_and_republish_action_link + * + * @return void */ public function test_add_rewrite_and_republish_action_link_unsuccessful_should_not_be_displayed() { $actions = [ @@ -386,6 +404,8 @@ public function test_add_rewrite_and_republish_action_link_unsuccessful_should_n * Tests the add_rewrite_and_republish_action_link function when the post is not published. * * @covers \Yoast\WP\Duplicate_Post\UI\Row_Actions::add_rewrite_and_republish_action_link + * + * @return void */ public function test_add_rewrite_and_republish_action_link_unsuccessful_not_published() { $actions = [ diff --git a/tests/Unit/Utils_Test.php b/tests/Unit/Utils_Test.php index f65b432ba..e46dddefc 100644 --- a/tests/Unit/Utils_Test.php +++ b/tests/Unit/Utils_Test.php @@ -17,6 +17,8 @@ final class Utils_Test extends TestCase { * * @param string $original Version number. * @param string $expected Expected output. + * + * @return void */ public function test_flatten_version( $original, $expected ) { $this->assertSame( $expected, Utils::flatten_version( $original ) ); @@ -25,7 +27,7 @@ public function test_flatten_version( $original, $expected ) { /** * Data provider for test_flatten_version. * - * @return array + * @return array> */ public static function flatten_version_provider() { return [ @@ -46,6 +48,8 @@ public static function flatten_version_provider() { * * @param mixed $original Input value. * @param mixed $expected Expected output. + * + * @return void */ public function test_addslashes_to_strings_only( $original, $expected ) { $this->assertSame( $expected, Utils::addslashes_to_strings_only( $original ) ); @@ -54,7 +58,7 @@ public function test_addslashes_to_strings_only( $original, $expected ) { /** * Data provider for test_addslashes_to_strings_only. * - * @return array + * @return array> */ public static function addslashes_to_strings_only_provider() { return [ diff --git a/tests/Unit/Watchers/Bulk_Actions_Watcher_Test.php b/tests/Unit/Watchers/Bulk_Actions_Watcher_Test.php index 81259c868..7ffd6c3b2 100644 --- a/tests/Unit/Watchers/Bulk_Actions_Watcher_Test.php +++ b/tests/Unit/Watchers/Bulk_Actions_Watcher_Test.php @@ -20,6 +20,8 @@ final class Bulk_Actions_Watcher_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -31,6 +33,8 @@ protected function set_up() { * Tests the constructor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Bulk_Actions_Watcher::__construct + * + * @return void */ public function test_constructor() { $this->instance->expects( 'register_hooks' )->once(); @@ -41,6 +45,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Bulk_Actions_Watcher::register_hooks + * + * @return void */ public function test_register_hooks() { $this->instance->register_hooks(); @@ -54,6 +60,8 @@ public function test_register_hooks() { * Tests the add_removable_query_args function. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Bulk_Actions_Watcher::add_removable_query_args + * + * @return void */ public function test_add_removable_query_args() { $array = [ @@ -124,6 +132,8 @@ public function test_add_removable_query_args() { * Tests the add_bulk_clone_admin_notice function when 1 post is copied. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Bulk_Actions_Watcher::add_bulk_clone_admin_notice + * + * @return void */ public function test_add_bulk_clone_admin_notice_1() { $this->stubEscapeFunctions(); @@ -143,6 +153,8 @@ public function test_add_bulk_clone_admin_notice_1() { * Tests the add_bulk_clone_admin_notice function when more than 1 post is copied. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Bulk_Actions_Watcher::add_bulk_clone_admin_notice + * + * @return void */ public function test_add_bulk_clone_admin_notice_2() { $this->stubEscapeFunctions(); @@ -162,6 +174,8 @@ public function test_add_bulk_clone_admin_notice_2() { * Tests the add_bulk_rewrite_and_republish_admin_notice function when 1 post is copied. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Bulk_Actions_Watcher::add_bulk_rewrite_and_republish_admin_notice + * + * @return void */ public function test_add_bulk_rewrite_and_republish_admin_notice_1() { $this->stubEscapeFunctions(); @@ -181,6 +195,8 @@ public function test_add_bulk_rewrite_and_republish_admin_notice_1() { * Tests the add_bulk_rewrite_and_republish_admin_notice function when more than 1 post is copied. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Bulk_Actions_Watcher::add_bulk_rewrite_and_republish_admin_notice + * + * @return void */ public function test_add_bulk_rewrite_and_republish_admin_notice_2() { $this->stubEscapeFunctions(); diff --git a/tests/Unit/Watchers/Copied_Post_Watcher_Test.php b/tests/Unit/Watchers/Copied_Post_Watcher_Test.php index 8b4bc91ce..7dae09e6b 100644 --- a/tests/Unit/Watchers/Copied_Post_Watcher_Test.php +++ b/tests/Unit/Watchers/Copied_Post_Watcher_Test.php @@ -30,6 +30,8 @@ final class Copied_Post_Watcher_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -46,6 +48,8 @@ protected function set_up() { * Tests the constructor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -58,6 +62,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::register_hooks + * + * @return void */ public function test_register_hooks() { $this->instance->register_hooks(); @@ -70,6 +76,8 @@ public function test_register_hooks() { * Tests the get_notice_text function when the copy is not scheduled. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::get_notice_text + * + * @return void */ public function test_get_notice_text_not_scheduled() { $this->stubTranslationFunctions(); @@ -96,6 +104,8 @@ public function test_get_notice_text_not_scheduled() { * Tests the get_notice_text function when the copy is scheduled. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::get_notice_text + * + * @return void */ public function test_get_notice_text_scheduled() { $this->stubTranslationFunctions(); @@ -131,6 +141,8 @@ public function test_get_notice_text_scheduled() { * Tests the get_notice_text function when the copy is in the trash. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::get_notice_text + * + * @return void */ public function test_get_notice_text_copy_in_the_trash() { $this->stubTranslationFunctions(); @@ -156,6 +168,8 @@ public function test_get_notice_text_copy_in_the_trash() { * Tests the add_admin_notice function on the Classic Editor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::add_admin_notice + * + * @return void */ public function test_add_admin_notice_classic() { $this->stubEscapeFunctions(); @@ -187,6 +201,8 @@ public function test_add_admin_notice_classic() { * Tests the add_admin_notice function when not on the Classic editor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::add_admin_notice + * + * @return void */ public function test_add_admin_notice_not_classic() { $this->permissions_helper @@ -202,6 +218,8 @@ public function test_add_admin_notice_not_classic() { * Tests the add_admin_notice function when the post does not have a copy intended for Rewrite & Republish. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::add_admin_notice + * + * @return void */ public function test_add_admin_notice_not_rewrite_and_republish() { $post = Mockery::mock( WP_Post::class ); @@ -227,6 +245,8 @@ public function test_add_admin_notice_not_rewrite_and_republish() { * Tests the add_block_editor_notice function. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::add_block_editor_notice + * + * @return void */ public function test_add_block_editor_notice() { $post = Mockery::mock( WP_Post::class ); @@ -268,6 +288,8 @@ public function test_add_block_editor_notice() { * Tests the add_block_editor_notice function when the post does not have a copy intended for Rewrite & Republish. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::add_block_editor_notice + * + * @return void */ public function test_add_block_editor_notice_not_rewrite_and_republish() { $post = Mockery::mock( WP_Post::class ); diff --git a/tests/Unit/Watchers/Link_Actions_Watcher_Test.php b/tests/Unit/Watchers/Link_Actions_Watcher_Test.php index ac4b5198f..7229185ed 100644 --- a/tests/Unit/Watchers/Link_Actions_Watcher_Test.php +++ b/tests/Unit/Watchers/Link_Actions_Watcher_Test.php @@ -29,6 +29,8 @@ final class Link_Actions_Watcher_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -45,6 +47,8 @@ protected function set_up() { * Tests the constructor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Link_Actions_Watcher::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -57,6 +61,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Link_Actions_Watcher::register_hooks + * + * @return void */ public function test_register_hooks() { $this->instance->register_hooks(); @@ -71,6 +77,8 @@ public function test_register_hooks() { * Tests the add_removable_query_args function. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Link_Actions_Watcher::add_removable_query_args + * + * @return void */ public function test_add_removable_query_args() { $array = [ @@ -141,6 +149,8 @@ public function test_add_removable_query_args() { * Tests the add_clone_admin_notice function on the Classic Editor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Link_Actions_Watcher::add_clone_admin_notice + * + * @return void */ public function test_add_clone_admin_notice_classic() { $this->stubEscapeFunctions(); @@ -164,6 +174,8 @@ public function test_add_clone_admin_notice_classic() { * Tests the add_clone_admin_notice function when not on the Classic editor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Link_Actions_Watcher::add_clone_admin_notice + * + * @return void */ public function test_add_clone_admin_notice_not_classic() { $_REQUEST['cloned'] = '1'; @@ -184,6 +196,8 @@ public function test_add_clone_admin_notice_not_classic() { * Tests the add_rewrite_and_republish_admin_notice function on the Classic editor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Link_Actions_Watcher::add_rewrite_and_republish_admin_notice + * + * @return void */ public function test_add_rewrite_and_republish_admin_notice_classic() { $this->stubTranslationFunctions(); @@ -206,6 +220,8 @@ public function test_add_rewrite_and_republish_admin_notice_classic() { * Tests the add_rewrite_and_republish_admin_notice function when not on the Classic editor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Link_Actions_Watcher::add_rewrite_and_republish_admin_notice + * + * @return void */ public function test_add_rewrite_and_republish_admin_notice_not_classic() { $_REQUEST['rewriting'] = '1'; @@ -226,6 +242,8 @@ public function test_add_rewrite_and_republish_admin_notice_not_classic() { * Tests the add_rewrite_and_republish_block_editor_notice function. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Link_Actions_Watcher::add_rewrite_and_republish_block_editor_notice + * + * @return void */ public function test_add_rewrite_and_republish_block_editor_notice() { $this->stubTranslationFunctions(); diff --git a/tests/Unit/Watchers/Original_Post_Watcher_Test.php b/tests/Unit/Watchers/Original_Post_Watcher_Test.php index 6237a41da..d9a35eba4 100644 --- a/tests/Unit/Watchers/Original_Post_Watcher_Test.php +++ b/tests/Unit/Watchers/Original_Post_Watcher_Test.php @@ -30,6 +30,8 @@ final class Original_Post_Watcher_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -46,6 +48,8 @@ protected function set_up() { * Tests the constructor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Original_Post_Watcher::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -58,6 +62,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Original_Post_Watcher::register_hooks + * + * @return void */ public function test_register_hooks() { $this->instance->register_hooks(); @@ -70,6 +76,8 @@ public function test_register_hooks() { * Tests the get_notice_text function. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Original_Post_Watcher::get_notice_text + * + * @return void */ public function test_get_notice_text() { $this->stubTranslationFunctions(); @@ -84,6 +92,8 @@ public function test_get_notice_text() { * Tests the add_admin_notice function on the Classic Editor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Original_Post_Watcher::add_admin_notice + * + * @return void */ public function test_add_admin_notice_classic() { $this->stubEscapeFunctions(); @@ -115,6 +125,8 @@ public function test_add_admin_notice_classic() { * Tests the add_admin_notice function when not on the Classic editor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Original_Post_Watcher::add_admin_notice + * + * @return void */ public function test_add_admin_notice_not_classic() { $this->permissions_helper @@ -130,6 +142,8 @@ public function test_add_admin_notice_not_classic() { * Tests the add_admin_notice function when the original has not changed. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::add_admin_notice + * + * @return void */ public function test_add_admin_notice_original_not_changed() { $post = Mockery::mock( WP_Post::class ); @@ -155,6 +169,8 @@ public function test_add_admin_notice_original_not_changed() { * Tests the add_block_editor_notice function. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::add_block_editor_notice + * + * @return void */ public function test_add_block_editor_notice() { $post = Mockery::mock( WP_Post::class ); @@ -195,6 +211,8 @@ public function test_add_block_editor_notice() { * Tests the add_block_editor_notice function when the original has not changed. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Copied_Post_Watcher::add_block_editor_notice + * + * @return void */ public function test_add_block_editor_notice_original_not_changed() { $post = Mockery::mock( WP_Post::class ); diff --git a/tests/Unit/Watchers/Republished_Post_Watcher_Test.php b/tests/Unit/Watchers/Republished_Post_Watcher_Test.php index 4907394f5..19b2a8a96 100644 --- a/tests/Unit/Watchers/Republished_Post_Watcher_Test.php +++ b/tests/Unit/Watchers/Republished_Post_Watcher_Test.php @@ -29,6 +29,8 @@ final class Republished_Post_Watcher_Test extends TestCase { /** * Sets the instance. + * + * @return void */ protected function set_up() { parent::set_up(); @@ -45,6 +47,8 @@ protected function set_up() { * Tests the constructor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Republished_Post_Watcher::__construct + * + * @return void */ public function test_constructor() { $this->assertInstanceOf( @@ -60,6 +64,8 @@ public function test_constructor() { * Tests the registration of the hooks. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Republished_Post_Watcher::register_hooks + * + * @return void */ public function test_register_hooks() { $this->instance->register_hooks(); @@ -73,6 +79,8 @@ public function test_register_hooks() { * Tests the get_notice_text function. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Republished_Post_Watcher::get_notice_text + * + * @return void */ public function test_get_notice_text() { $this->stubTranslationFunctions(); @@ -87,6 +95,8 @@ public function test_get_notice_text() { * Tests the add_admin_notice function on the Classic Editor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Republished_Post_Watcher::add_admin_notice + * + * @return void */ public function test_add_admin_notice_classic() { $this->stubEscapeFunctions(); @@ -113,6 +123,8 @@ public function test_add_admin_notice_classic() { * Tests the add_admin_notice function when not on the Classic editor. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Republished_Post_Watcher::add_admin_notice + * + * @return void */ public function test_add_admin_notice_not_classic() { $this->permissions_helper @@ -128,6 +140,8 @@ public function test_add_admin_notice_not_classic() { * Tests the add_block_editor_notice function. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Republished_Post_Watcher::add_block_editor_notice + * + * @return void */ public function test_add_block_editor_notice() { $this->instance @@ -163,6 +177,8 @@ public function test_add_block_editor_notice() { * Tests the add_removable_query_args function. * * @covers \Yoast\WP\Duplicate_Post\Watchers\Republished_Post_Watcher::add_removable_query_args + * + * @return void */ public function test_add_removable_query_args() { $array = [ diff --git a/tests/WP/Post_Duplicator_Test.php b/tests/WP/Post_Duplicator_Test.php index 675097729..bb7414d8e 100644 --- a/tests/WP/Post_Duplicator_Test.php +++ b/tests/WP/Post_Duplicator_Test.php @@ -21,6 +21,8 @@ final class Post_Duplicator_Test extends TestCase { /** * Setting up the instance of Post_Duplicator. + * + * @return void */ public function set_up() { parent::set_up(); @@ -37,6 +39,8 @@ public function set_up() { * @covers ::generate_copy_status * @covers ::generate_copy_author * @covers ::set_modified + * + * @return void */ public function test_create_duplicate() {