MDL-58219 oauth2: Fix unit tests because we changed the model

We added 2 fields to the model and we needed to update the tests.

I also removed some error_log from the rest client (very useful while developing)

Part of MDL-58220
This commit is contained in:
Damyon Wiese 2017-03-10 15:05:52 +08:00
parent ec504d94f6
commit dece386586
2 changed files with 3 additions and 6 deletions

View File

@ -103,13 +103,8 @@ abstract class rest {
$callargs = $rawpost;
}
error_log('CALL REST');
error_log($endpoint);
error_log(json_encode($callargs));
error_log($method);
$this->curl->setHeader('Content-type: application/json');
$response = $this->curl->$method($endpoint, $callargs);
error_log($response);
if ($this->curl->errno == 0) {
if ($responsetype == 'json') {

View File

@ -112,7 +112,9 @@ class core_oauth2_testcase extends advanced_testcase {
$data = (object) [
'issuerid' => $issuer->get('id'),
'refreshtoken' => 'abc',
'grantedscopes' => $requiredscopes
'grantedscopes' => $requiredscopes,
'email' => 'sys@example.com',
'username' => 'sys'
];
$sys = new \core\oauth2\system_account(0, $data);
$sys->create();