Skip to content

Commit

Permalink
Fixing typo and a minor issue in UserHasRoleTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
fubhy committed Jun 10, 2014
1 parent f138aa2 commit ed0278c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/src/Condition/UserHasRoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class UserHasRoleTest extends ConditionTestBase {
*/
public static function getInfo() {
return [
'name' => 'User has role(s( condition test',
'name' => 'User has role(s) condition test',
'description' => 'Tests the user has role(s) condition.',
'group' => 'Rules conditions',
];
Expand Down Expand Up @@ -140,12 +140,13 @@ public function testContextValue() {
* @covers ::evaluate()
*/
public function testConditionEvaluation() {
// Set-up a mock object with roles 'authenticated' and 'editor', but not 'administrator'.
// Set-up a mock object with roles 'authenticated' and 'editor', but not
// 'administrator'.
$this->account = $this->getMockBuilder('Drupal\user\Entity\User')
->disableOriginalConstructor()
->getMock();

$this->account->expects($this->any())
$this->account->expects($this->exactly(7))
->method('getRoles')
->will($this->returnValue(['authenticated', 'editor']));

Expand All @@ -172,7 +173,8 @@ public function testConditionEvaluation() {
$this->condition->setContextValue('operation', 'OR');
$this->assertTrue($this->condition->evaluate());

// User doesn't have the administrator role, but has the authenticated, should succeed.
// User doesn't have the administrator role, but has the authenticated,
// should succeed.
$this->condition->setContextValue('roles', ['authenticated', 'administrator']);
$this->condition->setContextValue('operation', 'OR');
$this->assertTrue($this->condition->evaluate());
Expand Down

0 comments on commit ed0278c

Please sign in to comment.