Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Sep 3, 2020
1 parent f412cca commit 20284e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/php/test-class-dev-tools-user-access.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ] );

Expand Down Expand Up @@ -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 ] ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 20284e4

Please sign in to comment.