Skip to content

Commit

Permalink
Add tests for string true and false
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Hoover committed Jun 18, 2020
1 parent 18cb041 commit f78c7db
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/functional/WPDbUserCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,24 @@ public function it_should_set_the_user_level_to_0_by_default(FunctionalTester $I
$I->seeUserMetaInDatabase($criteria);
}

public function it_should_set_bool_meta_to_true_false_by_default(FunctionaLTester $I) {
$I->haveUserInDatabase('Luca');
$userId = $I->grabUserIdFromDatabase('Luca');
$criteria = [
'user_id' => $userId,
'meta_key' => $I->grabPrefixedTableNameFor('show_admin_bar_front'),
'meta_value' => 'true',
];
$I->seeUserMetaInDatabase($criteria);

$criteria['meta_key'] = $I->grabPrefixedTableNameFor('rich_editing');
$I->seeUserMetaInDatabase($criteria);

$criteria['meta_key'] = $I->grabPrefixedTableNameFor('comment_shortcuts');
$criteria['meta_value'] = 'false';
$I->seeUserMetaInDatabase($criteria);
}

/**
* @test
* it should allow overriding the default user level and role
Expand Down

0 comments on commit f78c7db

Please sign in to comment.