public function test_mod_lti_get_tool_types() { // Create a tool proxy. $proxy = mod_lti_external::create_tool_proxy('Test proxy', $this->getExternalTestFileUrl('/test.html'), array(), array()); // Create a tool type, associated with that proxy. $type = new stdClass(); $data = new stdClass(); $type->state = LTI_TOOL_STATE_CONFIGURED; $type->name = "Test tool"; $type->description = "Example description"; $type->toolproxyid = $proxy->id; $type->baseurl = $this->getExternalTestFileUrl('/test.html'); $typeid = lti_add_type($type, $data); $types = mod_lti_external::get_tool_types($proxy->id); $this->assertEquals(1, count($types)); $type = $types[0]; $this->assertEquals('Test tool', $type['name']); $this->assertEquals('Example description', $type['description']); }