Skip to content

Commit

Permalink
Completing unit test for access
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Feb 23, 2012
1 parent cdba6ce commit 254620a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/suite/joomla/access/JAccessTest.php
Expand Up @@ -439,7 +439,6 @@ public function testGetGroupsByUser()
$this->markTestSkipped('The database is not available'); $this->markTestSkipped('The database is not available');
} }


$access = new JAccess();
$array1 = array( $array1 = array(
0 => 1, 0 => 1,
1 => 6, 1 => 6,
Expand All @@ -448,21 +447,26 @@ public function testGetGroupsByUser()
); );
$this->assertThat( $this->assertThat(
$array1, $array1,
$this->equalTo($access->getGroupsByUser(42, True)) $this->equalTo(JAccess::getGroupsByUser(42, True))
); );


$array2 = array( $array2 = array(
0 => 8 0 => 8
); );
$this->assertThat( $this->assertThat(
$array2, $array2,
$this->equalTo($access->getGroupsByUser(42, False)) $this->equalTo(JAccess::getGroupsByUser(42, False))
); );


jimport('joomla.application.component.helper'); jimport('joomla.application.component.helper');


$this->assertThat( $this->assertThat(
$access->getGroupsByUser(null), JAccess::getGroupsByUser(null),
$this->equalTo(array(1))
);

$this->assertThat(
JAccess::getGroupsByUser(null, false),
$this->equalTo(array(1)) $this->equalTo(array(1))
); );
} }
Expand Down

0 comments on commit 254620a

Please sign in to comment.