/** * Test we cannot create a competency with nasty data. */ public function test_create_competency_with_nasty_data() { $this->setUser($this->creator); $framework = $this->create_competency_framework(1, true); $this->setExpectedException('invalid_parameter_exception'); $competency = array('shortname' => 'shortname<a href="">', 'idnumber' => 'id;"number', 'description' => 'de<>\\..scription', 'descriptionformat' => FORMAT_HTML, 'competencyframeworkid' => $framework->id, 'sortorder' => 0); $result = external::create_competency($competency); $result = (object) external_api::clean_returnvalue(external::create_competency_returns(), $result); }