public function test_get_signup_settings() { global $CFG; $CFG->defaultcity = 'Bcn'; $CFG->country = 'ES'; $CFG->sitepolicy = 'https://moodle.org'; $result = auth_email_external::get_signup_settings(); $result = external_api::clean_returnvalue(auth_email_external::get_signup_settings_returns(), $result); // Check expected data. $this->assertEquals(array('firstname', 'lastname'), $result['namefields']); $this->assertEquals($CFG->defaultcity, $result['defaultcity']); $this->assertEquals($CFG->country, $result['country']); $this->assertEquals($CFG->sitepolicy, $result['sitepolicy']); $this->assertEquals(print_password_policy(), $result['passwordpolicy']); $this->assertNotContains('recaptchachallengehash', $result); $this->assertNotContains('recaptchachallengeimage', $result); $this->assertCount(2, $result['profilefields']); $this->assertEquals('text', $result['profilefields'][0]['datatype']); $this->assertEquals('textarea', $result['profilefields'][1]['datatype']); }