BUG FIX: column names quoted properly

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100693 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2010-03-09 02:29:57 +00:00 committed by Sam Minnee
parent 4b14821bee
commit 7af896d9ec
3 changed files with 10 additions and 10 deletions

View File

@ -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');
}
}

View File

@ -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');
}

View File

@ -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');
}
}