function CtoolsModuleTestCase::testGetUserRoles
Test that the (deprecated) getuserroles returns expected array.
File
-
tests/
ctools.test, line 71
Class
- CtoolsModuleTestCase
- Test menu links depending on user permissions.
Code
public function testGetUserRoles() {
$result = ctools_get_roles();
$this->assertTrue(is_array($result), 'get_roles returns an array');
// A key-value array of integers.
foreach ($result as $k => $v) {
$this->assertTrue(is_numeric($k), 'Role key is numeric; ' . $k);
$this->assertTrue(is_string($v), 'Role id is string; ' . $v);
}
}