diff --git a/tests/phpunit/helper-functions/test-class-admin.php b/tests/phpunit/helper-functions/test-class-admin.php index a750243..78ad16a 100644 --- a/tests/phpunit/helper-functions/test-class-admin.php +++ b/tests/phpunit/helper-functions/test-class-admin.php @@ -30,7 +30,7 @@ public static function set_up_before_class() { } /** - * Tests class constructor. + * Tests hooks registration. * * @covers Admin::register_hooks */ @@ -42,4 +42,31 @@ public function test_register_hooks() { $this->assertSame( 10, has_action( 'manage_post_tag_custom_column', [ self::$class_instance, 'manage_tag_columns' ] ), 10, 3 ); $this->assertSame( 10, has_action( 'tag_row_actions', [ self::$class_instance, 'remove_view_action' ] ), 10, 2 ); } + + /** + * Tests settings registration. + * + * @covers Admin::register_settings + */ + public function test_register_settings() { + self::$class_instance->register_settings(); + + global $wp_settings_sections, $wp_settings_fields; + + $this->assertArrayHasKey( 'fewer_tags_section', $wp_settings_sections ); + $this->assertArrayHasKey( 'joost_min_posts_count', $wp_settings_fields ); + } + + /** + * Tests display section. + * + * @covers Admin::display_section + */ + public function test_display_section() { + ob_start(); + self::$class_instance->display_section(); + $output = ob_get_clean(); + + $this->assertSame( 'Set the minimum number of posts a tag should have to become live on the site and not be redirected to the homepage.', $output ); + } }