handle user roles by organization
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user