'test_'. str_random(16).'@test.com', 'first_name' => 'test_'. str_random(16), 'last_name' => 'test_'. str_random(16), ]; $params = [ ]; $headers = [ "HTTP_Authorization" => " Bearer " . $this->access_token, "CONTENT_TYPE" => "application/json" ]; $response = $this->action ( "POST", "Api\\OAuth2\\OAuth2UserRegistrationRequestApiController@register", $params, [], [], [], $headers, json_encode($data) ); $this->assertResponseStatus(201); $content = $response->getContent(); $user_registration_request = json_decode($content); $this->assertTrue(!empty($user_registration_request->hash)); $params = [ 'token' => $user_registration_request->hash, 'redirect_uri' => 'https://www.test.com/oauth2' ]; } protected function getScopes() { $scope = [ "openid", IUserScopes::Registration, ]; return $scope; } }