/** * @desc Builds the array at the legacy format containing only the action's authorizations. * @return mixed[] The array at the legacy format. */ public function build_auth_array() { $auth_array = $this->roles->build_auth_array(); foreach ($auth_array as &$profile) { $profile *= $this->bit; } return $auth_array; }
function test_with_complete_auth() { $array = array('r1' => 1, 'r0' => 1, 'r-1' => 1, 'm1' => 1, '4' => 1); $auths = new RolesAuthorizations($array); self::assertEquals($array, $auths->build_auth_array()); }