mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG FIX: column names quoted properly (from r100693)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105625 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b717d19457
commit
79b912f7b1
@ -83,8 +83,8 @@ class GroupTest extends FunctionalTest {
|
||||
|
||||
$adminGroup->delete();
|
||||
|
||||
$this->assertNull(DataObject::get('Group', "ID={$adminGroup->ID}"), 'Group is removed');
|
||||
$this->assertNull(DataObject::get('Permission',"GroupID={$adminGroup->ID}"), 'Permissions removed along with the group');
|
||||
$this->assertNull(DataObject::get('Group', "\"ID\"={$adminGroup->ID}"), 'Group is removed');
|
||||
$this->assertNull(DataObject::get('Permission',"\"GroupID\"={$adminGroup->ID}"), 'Permissions removed along with the group');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ class PermissionCheckboxSetFieldTest extends SapphireTest {
|
||||
$this->assertEquals($group->Permissions()->Count(), 0, 'The tested group has no permissions');
|
||||
|
||||
$this->assertEquals($untouchable->Permissions()->Count(), 1, 'The other group has one permission');
|
||||
$this->assertEquals($untouchable->Permissions("Code='ADMIN'")->Count(), 1, 'The other group has ADMIN permission');
|
||||
$this->assertEquals($untouchable->Permissions("\"Code\"='ADMIN'")->Count(), 1, 'The other group has ADMIN permission');
|
||||
|
||||
$this->assertEquals(DataObject::get('Permission')->Count(), $baseCount, 'There are no orphaned permissions');
|
||||
|
||||
@ -60,11 +60,11 @@ class PermissionCheckboxSetFieldTest extends SapphireTest {
|
||||
$group->flushCache();
|
||||
$untouchable->flushCache();
|
||||
$this->assertEquals($group->Permissions()->Count(), 2, 'The tested group has two permissions permission');
|
||||
$this->assertEquals($group->Permissions("Code='ADMIN'")->Count(), 1, 'The tested group has ADMIN permission');
|
||||
$this->assertEquals($group->Permissions("Code='CMS_ACCESS_AssetAdmin'")->Count(), 1, 'The tested group has CMS_ACCESS_AssetAdmin permission');
|
||||
$this->assertEquals($group->Permissions("\"Code\"='ADMIN'")->Count(), 1, 'The tested group has ADMIN permission');
|
||||
$this->assertEquals($group->Permissions("\"Code\"='CMS_ACCESS_AssetAdmin'")->Count(), 1, 'The tested group has CMS_ACCESS_AssetAdmin permission');
|
||||
|
||||
$this->assertEquals($untouchable->Permissions()->Count(), 1, 'The other group has one permission');
|
||||
$this->assertEquals($untouchable->Permissions("Code='ADMIN'")->Count(), 1, 'The other group has ADMIN permission');
|
||||
$this->assertEquals($untouchable->Permissions("\"Code\"='ADMIN'")->Count(), 1, 'The other group has ADMIN permission');
|
||||
|
||||
$this->assertEquals(DataObject::get('Permission')->Count(), $baseCount+2, 'There are no orphaned permissions');
|
||||
|
||||
@ -77,10 +77,10 @@ class PermissionCheckboxSetFieldTest extends SapphireTest {
|
||||
$group->flushCache();
|
||||
$untouchable->flushCache();
|
||||
$this->assertEquals($group->Permissions()->Count(), 1, 'The tested group has 1 permission');
|
||||
$this->assertEquals($group->Permissions("Code='ADMIN'")->Count(), 1, 'The tested group has ADMIN permission');
|
||||
$this->assertEquals($group->Permissions("\"Code\"='ADMIN'")->Count(), 1, 'The tested group has ADMIN permission');
|
||||
|
||||
$this->assertEquals($untouchable->Permissions()->Count(), 1, 'The other group has one permission');
|
||||
$this->assertEquals($untouchable->Permissions("Code='ADMIN'")->Count(), 1, 'The other group has ADMIN permission');
|
||||
$this->assertEquals($untouchable->Permissions("\"Code\"='ADMIN'")->Count(), 1, 'The other group has ADMIN permission');
|
||||
|
||||
$this->assertEquals(DataObject::get('Permission')->Count(), $baseCount+1, 'There are no orphaned permissions');
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ class PermissionRoleTest extends FunctionalTest {
|
||||
|
||||
$role->delete();
|
||||
|
||||
$this->assertNull(DataObject::get('PermissionRole', "ID={$role->ID}"), 'Role is removed');
|
||||
$this->assertNull(DataObject::get('PermissionRoleCode',"RoleID={$role->ID}"), 'Permissions removed along with the role');
|
||||
$this->assertNull(DataObject::get('PermissionRole', "\"ID\"={$role->ID}"), 'Role is removed');
|
||||
$this->assertNull(DataObject::get('PermissionRoleCode',"\"RoleID\"={$role->ID}"), 'Permissions removed along with the role');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user