/** * Testing that a log file is generated when logging is turned on. */ public function test_handle_log() { global $CFG; $this->resetAfterTest(); $handler = new service_exception_handler(true); ob_start(); $handler->handle(new Exception('Error happened')); ob_end_clean(); $this->assertTrue(is_dir($CFG->dataroot . '/temp/mod_lti')); $files = glob($CFG->dataroot . '/temp/mod_lti/mod_lti_response*'); $this->assertEquals(1, count($files)); }