SUBSCRIBE_USER_TO_SESSION_FROM_USERNAME now takes parameter username rather than userName - refs BT#16535

pull/3057/head
Sébastien Ducoulombier 6 years ago
parent 1bf0a8d6ef
commit d85146dfdf
  1. 4
      main/webservices/api/tests/SubscribeUserToSessionFromUsernameTest.php
  2. 4
      main/webservices/api/tests/UpdateUserFromUsernameTest.php
  3. 4
      main/webservices/api/v2.php

@ -19,7 +19,7 @@ class SubscribeUserToSessionFromUsernameTest extends V2TestCase
}
/**
* subscribes a test user to a test session that already have another user subscribed
* subscribes a test user to a test session that already has another user subscribed
* asserts that the user was subscribed to the session
* asserts that the other user was not unsubscribed from the session
*/
@ -43,7 +43,7 @@ class SubscribeUserToSessionFromUsernameTest extends V2TestCase
SessionManager::subscribeUsersToSession($sessionId, [$anotherUserId]);
// call the webservice to subscribe the first user to the session
$subscribed = $this->boolean([ 'sessionId' => $sessionId, 'loginName' => $loginName ] );
$subscribed = $this->boolean([ 'sessionId' => $sessionId, 'loginname' => $loginName ] );
$this->assertTrue($subscribed);
// assert we now have two users subscribed to the session

@ -65,12 +65,12 @@ class UpdateUserFromUsernameTest extends V2TestCase
$parameters['extra'] = [
[ 'field_name' => $extraFieldName, 'field_value' => $extraFieldNewValue ],
];
$parameters['loginName'] = $loginName;
$parameters['loginname'] = $loginName;
$updated = $this->boolean($parameters);
$this->assertTrue($updated);
// assert the webservice reports an error with a non-existent login name
$parameters['loginName'] = 'santaClaus';
$parameters['loginname'] = 'santaClaus';
$this->assertSame('UserNotFound', $this->errorMessageString($parameters));
// compare each saved value to the original

@ -301,10 +301,10 @@ try {
$restResponse->setData([$newSessionId]);
break;
case Rest::SUBSCRIBE_USER_TO_SESSION_FROM_USERNAME:
if (empty($_POST['sessionId']) || empty($_POST['loginName'])) {
if (empty($_POST['sessionId']) || empty($_POST['loginname'])) {
throw new Exception(get_lang('NoData'));
}
$subscribed = $restApi->subscribeUserToSessionFromUsername($_POST['sessionId'], $_POST['loginName']);
$subscribed = $restApi->subscribeUserToSessionFromUsername($_POST['sessionId'], $_POST['loginname']);
$restResponse->setData([$subscribed]);
break;
case Rest::GET_SESSION_FROM_EXTRA_FIELD;

Loading…
Cancel
Save