Example #1
0
function lti_get_tool_by_url_match($url, $courseid = null, $state = LTI_TOOL_STATE_CONFIGURED) {
    $possibletools = lti_get_tools_by_url($url, $state, $courseid);

    return lti_get_best_tool_by_url($url, $possibletools, $courseid);
}
Example #2
0
 /**
  * Test lti_get_best_tool_by_url.
  *
  * @dataProvider lti_get_best_tool_by_url_provider
  * @param string $url The URL to test.
  * @param object $expected The expected tool matching the URL.
  * @param array $tools The pool of tools to match the URL with.
  */
 public function test_lti_get_best_tool_by_url($url, $expected, $tools) {
     $actual = lti_get_best_tool_by_url($url, $tools, null);
     $this->assertSame($expected, $actual);
 }