Permalink
Browse files

Completing unit test for access

  • Loading branch information...
1 parent cdba6ce commit 254620a5dc75b58b5783416fc0fb2e591b0e767e @chdemko committed Feb 23, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 tests/suite/joomla/access/JAccessTest.php
@@ -439,7 +439,6 @@ public function testGetGroupsByUser()
$this->markTestSkipped('The database is not available');
}
- $access = new JAccess();
$array1 = array(
0 => 1,
1 => 6,
@@ -448,21 +447,26 @@ public function testGetGroupsByUser()
);
$this->assertThat(
$array1,
- $this->equalTo($access->getGroupsByUser(42, True))
+ $this->equalTo(JAccess::getGroupsByUser(42, True))
);
$array2 = array(
0 => 8
);
$this->assertThat(
$array2,
- $this->equalTo($access->getGroupsByUser(42, False))
+ $this->equalTo(JAccess::getGroupsByUser(42, False))
);
jimport('joomla.application.component.helper');
$this->assertThat(
- $access->getGroupsByUser(null),
+ JAccess::getGroupsByUser(null),
+ $this->equalTo(array(1))
+ );
+
+ $this->assertThat(
+ JAccess::getGroupsByUser(null, false),
$this->equalTo(array(1))
);
}

0 comments on commit 254620a

Please sign in to comment.