Behat test: Fix createUserViaCSV.feature

pull/3064/head
Julio 5 years ago
parent bdc79907ac
commit a97af80518
  1. 30
      public/main/inc/lib/api.lib.php
  2. 2
      tests/behat/features/createUserViaCSV.feature

@ -57,14 +57,6 @@ define('STUDENT_BOSS', 17); // student is boss
define('INVITEE', 20);
define('HRM_REQUEST', 21); //HRM has request for vinculation with user
// Table of status
$_status_list[COURSEMANAGER] = 'teacher'; // 1
$_status_list[SESSIONADMIN] = 'session_admin'; // 3
$_status_list[DRH] = 'drh'; // 4
$_status_list[STUDENT] = 'user'; // 5
$_status_list[ANONYMOUS] = 'anonymous'; // 6
$_status_list[INVITEE] = 'invited'; // 20
// COURSE VISIBILITY CONSTANTS
/** only visible for course admin */
define('COURSE_VISIBILITY_CLOSED', 0);
@ -5375,6 +5367,20 @@ function api_get_software_name()
}
}
function api_get_status_list()
{
$list = [];
// Table of status
$list[COURSEMANAGER] = 'teacher'; // 1
$list[SESSIONADMIN] = 'session_admin'; // 3
$list[DRH] = 'drh'; // 4
$list[STUDENT] = 'user'; // 5
$list[ANONYMOUS] = 'anonymous'; // 6
$list[INVITEE] = 'invited'; // 20
return $list;
}
/**
* Checks whether status given in parameter exists in the platform.
*
@ -5384,9 +5390,9 @@ function api_get_software_name()
*/
function api_status_exists($status_asked)
{
global $_status_list;
$list = api_get_status_list();
return in_array($status_asked, $_status_list) ? true : isset($_status_list[$status_asked]);
return in_array($status_asked, $list) ? true : isset($list[$status_asked]);
}
/**
@ -5401,9 +5407,9 @@ function api_status_exists($status_asked)
*/
function api_status_key($status)
{
global $_status_list;
$list = api_get_status_list();
return isset($_status_list[$status]) ? $status : array_search($status, $_status_list);
return isset($list[$status]) ? $status : array_search($status, $list);
}
/**

@ -4,7 +4,7 @@ Feature: Users creation via CSV
Scenario: Import user via CSV
Given I am a platform administrator
And I am on "/main/admin/user_import.php"
Then I attach the file "/main/admin/example.csv" to "import_file"
Then I attach the file "/public/main/admin/example.csv" to "import_file"
Then I press "Import"
Then I should see "File imported"
Then I am on "main/admin/user_list.php?keyword=drbrown@example.net"

Loading…
Cancel
Save