| Línea 29... |
Línea 29... |
| 29 |
* @category test
|
29 |
* @category test
|
| 30 |
* @copyright 2023 the Open University
|
30 |
* @copyright 2023 the Open University
|
| 31 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
31 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 32 |
* @covers \core_question\local\bank\context_to_string_translator
|
32 |
* @covers \core_question\local\bank\context_to_string_translator
|
| 33 |
*/
|
33 |
*/
|
| 34 |
class context_to_string_translator_test extends \advanced_testcase {
|
34 |
final class context_to_string_translator_test extends \advanced_testcase {
|
| Línea 35... |
Línea 35... |
| 35 |
|
35 |
|
| 36 |
public function test_context_to_string_translator_test_good_case(): void {
|
36 |
public function test_context_to_string_translator_test_good_case(): void {
|
| 37 |
$this->resetAfterTest();
|
37 |
$this->resetAfterTest();
|
| Línea 48... |
Línea 48... |
| 48 |
|
48 |
|
| 49 |
$quiz = $generator->create_module('quiz', ['course' => $course->id]);
|
49 |
$quiz = $generator->create_module('quiz', ['course' => $course->id]);
|
| Línea 50... |
Línea 50... |
| 50 |
$quizcontext = context_module::instance($quiz->cmid);
|
50 |
$quizcontext = context_module::instance($quiz->cmid);
|
| 51 |
|
51 |
|
| Línea 52... |
Línea 52... |
| 52 |
// Create the context_to_string_translator.
|
52 |
// Create the context_to_string_translator.
|
| 53 |
$translator = new context_to_string_translator((new question_edit_contexts($quizcontext))->all());
|
53 |
$translator = new context_to_string_translator([$systemcontext, $categorycontext, $coursecontext, $quizcontext]);
|
| 54 |
|
54 |
|