handle user roles by organization

This commit is contained in:
Almira Krdzic
2018-10-11 04:16:43 +02:00
parent 9a8e05e341
commit 84cd11f9c9
29 changed files with 1341 additions and 124 deletions

View File

@@ -28,6 +28,8 @@ class Wiaas_User_Organization_Test extends Wiaas_Unit_Test_Case {
Wiaas_User_Organization::TAXONOMY_NAME
)['term_id'];
update_user_meta($this->user_id, '_wiaas_organization_id', $this->user_organization_id);
# create department
$this->user_department_id = wp_insert_term(
$this->user_department_name,
@@ -63,11 +65,10 @@ class Wiaas_User_Organization_Test extends Wiaas_Unit_Test_Case {
* @covers Wiaas_User_Organization::get_user_organization()
*/
function test_retrieve_user_organization() {
$organization = Wiaas_User_Organization::get_user_organization($this->user_id);
$organization_id = Wiaas_User_Organization::get_user_organization_id($this->user_id);
$this->assertNotNull($organization);
$this->assertEquals($organization->term_id, $this->user_organization_id);
$this->assertEquals($organization->name, $this->user_organization_name);
$this->assertNotNull($organization_id);
$this->assertEquals($organization_id, $this->user_organization_id);
}
/**