From 20284e495b99d468e7ebf5e9c91c1f3c152b3f94 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Thu, 3 Sep 2020 15:27:11 -0700 Subject: [PATCH] Fix tests --- tests/php/test-class-dev-tools-user-access.php | 2 ++ tests/php/validation/test-class-amp-validated-url-post-type.php | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/php/test-class-dev-tools-user-access.php b/tests/php/test-class-dev-tools-user-access.php index 3baf93f0958..3fb259c158a 100644 --- a/tests/php/test-class-dev-tools-user-access.php +++ b/tests/php/test-class-dev-tools-user-access.php @@ -51,6 +51,7 @@ public function test_register() { * @covers ::is_user_enabled */ public function test_is_user_enabled() { + AMP_Options_Manager::update_option( Option::THEME_SUPPORT, AMP_Theme_Support::STANDARD_MODE_SLUG ); $admin_user = self::factory()->user->create_and_get( [ 'role' => 'administrator' ] ); $editor_user = self::factory()->user->create_and_get( [ 'role' => 'editor' ] ); @@ -201,6 +202,7 @@ public function test_update_user_setting() { * @covers ::rest_get_dev_tools_enabled */ public function test_rest_get_dev_tools_enabled() { + AMP_Options_Manager::update_option( Option::THEME_SUPPORT, AMP_Theme_Support::STANDARD_MODE_SLUG ); $user = self::factory()->user->create_and_get( [ 'role' => 'author' ] ); $this->assertFalse( $this->dev_tools_user_access->rest_get_dev_tools_enabled( [ 'id' => $user->ID ] ) ); diff --git a/tests/php/validation/test-class-amp-validated-url-post-type.php b/tests/php/validation/test-class-amp-validated-url-post-type.php index 9e4b5a00820..d344cd25b98 100644 --- a/tests/php/validation/test-class-amp-validated-url-post-type.php +++ b/tests/php/validation/test-class-amp-validated-url-post-type.php @@ -84,6 +84,7 @@ public function test_register() { * @covers \AMP_Validated_URL_Post_Type::add_admin_hooks() */ public function test_add_admin_hooks() { + AMP_Options_Manager::update_option( Option::THEME_SUPPORT, AMP_Theme_Support::STANDARD_MODE_SLUG ); wp_set_current_user( self::factory()->user->create( [ 'role' => 'administrator' ] ) ); AMP_Validated_URL_Post_Type::add_admin_hooks();