2009-12-16 06:43:59 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2012-04-12 08:02:46 +02:00
|
|
|
* @package framework
|
2009-12-16 06:43:59 +01:00
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
class PermissionRoleTest extends FunctionalTest {
|
2013-03-21 19:48:54 +01:00
|
|
|
protected static $fixture_file = 'PermissionRoleTest.yml';
|
2009-12-16 06:43:59 +01:00
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function testDelete() {
|
2009-12-16 06:43:59 +01:00
|
|
|
$role = $this->objFromFixture('PermissionRole', 'role');
|
|
|
|
|
|
|
|
$role->delete();
|
|
|
|
|
2012-09-26 23:34:00 +02:00
|
|
|
$this->assertEquals(0, DataObject::get('PermissionRole', "\"ID\"={$role->ID}")->count(),
|
|
|
|
'Role is removed');
|
|
|
|
$this->assertEquals(0, DataObject::get('PermissionRoleCode',"\"RoleID\"={$role->ID}")->count(),
|
|
|
|
'Permissions removed along with the role');
|
2009-12-16 06:43:59 +01:00
|
|
|
}
|
|
|
|
}
|