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 {
|
2011-03-30 08:49:11 +02:00
|
|
|
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();
|
|
|
|
|
2009-11-22 06:16:38 +01: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
|
|
|
}
|
|
|
|
}
|