mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: fixed test that was trying to do a assertContains between a DataObjectSet and a Member object. Changed it to an assertEquals between Member and the First item in the Set. Also added an inverse test to check that Set doesn't contain the wrong Member.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98114 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
18b36a60ca
commit
b48c1fb883
@ -55,9 +55,11 @@ class PermissionTest extends SapphireTest {
|
||||
*/
|
||||
function testGettingMembersByPermission() {
|
||||
$accessMember = $this->objFromFixture('Member', 'access');
|
||||
|
||||
$accessAuthor = $this->objFromFixture('Member', 'author');
|
||||
|
||||
$result = Permission::get_members_by_permission(array('CMS_ACCESS_SecurityAdmin'));
|
||||
|
||||
$this->assertContains($result, $accessMember, 'Member is found via a permission attached to a role');
|
||||
|
||||
$this->assertEquals($result->First(),$accessMember);
|
||||
$this->assertNotEquals($result->First(),$accessAuthor);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user