| Línea 28... |
Línea 28... |
| 28 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
28 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 29 |
* @covers \core_renderer
|
29 |
* @covers \core_renderer
|
| 30 |
*/
|
30 |
*/
|
| 31 |
final class core_renderer_test extends \advanced_testcase {
|
31 |
final class core_renderer_test extends \advanced_testcase {
|
| 32 |
/**
|
32 |
/**
|
| 33 |
* @covers \core\hook\before_standard_top_of_body_html_generation
|
33 |
* @covers \core\hook\output\before_standard_top_of_body_html_generation
|
| 34 |
*/
|
34 |
*/
|
| 35 |
public function test_standard_top_of_body_html(): void {
|
35 |
public function test_standard_top_of_body_html(): void {
|
| 36 |
$page = new moodle_page();
|
36 |
$page = new moodle_page();
|
| 37 |
$renderer = new core_renderer($page, RENDERER_TARGET_GENERAL);
|
37 |
$renderer = new core_renderer($page, RENDERER_TARGET_GENERAL);
|
| Línea 40... |
Línea 40... |
| 40 |
$this->assertIsString($html);
|
40 |
$this->assertIsString($html);
|
| 41 |
$this->assertStringNotContainsString('A heading can be added to the top of the body HTML', $html);
|
41 |
$this->assertStringNotContainsString('A heading can be added to the top of the body HTML', $html);
|
| 42 |
}
|
42 |
}
|
| Línea 43... |
Línea 43... |
| 43 |
|
43 |
|
| 44 |
/**
|
44 |
/**
|
| 45 |
* @covers \core\hook\before_standard_top_of_body_html_generation
|
45 |
* @covers \core\hook\output\before_standard_top_of_body_html_generation
|
| 46 |
*/
|
46 |
*/
|
| 47 |
public function test_before_standard_top_of_body_html_generation_hooked(): void {
|
47 |
public function test_before_standard_top_of_body_html_generation_hooked(): void {
|
| Línea 48... |
Línea 48... |
| 48 |
require_once(__DIR__ . '/fixtures/core_renderer/before_standard_top_of_body_html_generation_callbacks.php');
|
48 |
require_once(__DIR__ . '/fixtures/core_renderer/before_standard_top_of_body_html_generation_callbacks.php');
|
| Línea 61... |
Línea 61... |
| 61 |
$this->assertIsString($html);
|
61 |
$this->assertIsString($html);
|
| 62 |
$this->assertStringContainsString('A heading can be added to the top of the body HTML', $html);
|
62 |
$this->assertStringContainsString('A heading can be added to the top of the body HTML', $html);
|
| 63 |
}
|
63 |
}
|
| Línea 64... |
Línea 64... |
| 64 |
|
64 |
|
| 65 |
/**
|
65 |
/**
|
| 66 |
* @covers \core\hook\before_footer_html_generation
|
66 |
* @covers \core\hook\output\before_footer_html_generation
|
| 67 |
*/
|
67 |
*/
|
| 68 |
public function test_before_footer_html_generation(): void {
|
68 |
public function test_before_footer_html_generation(): void {
|
| 69 |
$this->resetAfterTest();
|
69 |
$this->resetAfterTest();
|
| 70 |
$page = new moodle_page();
|
70 |
$page = new moodle_page();
|
| Línea 77... |
Línea 77... |
| 77 |
$this->assertIsString($html);
|
77 |
$this->assertIsString($html);
|
| 78 |
$this->assertStringNotContainsString('A heading can be added', $html);
|
78 |
$this->assertStringNotContainsString('A heading can be added', $html);
|
| 79 |
}
|
79 |
}
|
| Línea 80... |
Línea 80... |
| 80 |
|
80 |
|
| 81 |
/**
|
81 |
/**
|
| 82 |
* @covers \core\hook\before_footer_html_generation
|
82 |
* @covers \core\hook\output\before_footer_html_generation
|
| 83 |
*/
|
83 |
*/
|
| 84 |
public function test_before_footer_html_generation_hooked(): void {
|
84 |
public function test_before_footer_html_generation_hooked(): void {
|
| 85 |
$this->resetAfterTest();
|
85 |
$this->resetAfterTest();
|
| Línea 102... |
Línea 102... |
| 102 |
$this->assertIsString($html);
|
102 |
$this->assertIsString($html);
|
| 103 |
$this->assertStringContainsString('A heading can be added', $html);
|
103 |
$this->assertStringContainsString('A heading can be added', $html);
|
| 104 |
}
|
104 |
}
|
| Línea 105... |
Línea 105... |
| 105 |
|
105 |
|
| 106 |
/**
|
106 |
/**
|
| 107 |
* @covers \core\hook\before_standard_footer_html_generation
|
107 |
* @covers \core\hook\output\before_standard_footer_html_generation
|
| 108 |
*/
|
108 |
*/
|
| 109 |
public function before_standard_footer_html_generation(): void {
|
109 |
public function before_standard_footer_html_generation(): void {
|
| 110 |
$page = new moodle_page();
|
110 |
$page = new moodle_page();
|
| Línea 114... |
Línea 114... |
| 114 |
$this->assertIsString($html);
|
114 |
$this->assertIsString($html);
|
| 115 |
$this->assertStringNotContainsString('A heading can be added', $html);
|
115 |
$this->assertStringNotContainsString('A heading can be added', $html);
|
| 116 |
}
|
116 |
}
|
| Línea 117... |
Línea 117... |
| 117 |
|
117 |
|
| 118 |
/**
|
118 |
/**
|
| 119 |
* @covers \core\hook\before_standard_footer_html_generation
|
119 |
* @covers \core\hook\output\before_standard_footer_html_generation
|
| 120 |
*/
|
120 |
*/
|
| 121 |
public function test_before_standard_footer_html_generation_hooked(): void {
|
121 |
public function test_before_standard_footer_html_generation_hooked(): void {
|
| Línea 122... |
Línea 122... |
| 122 |
require_once(__DIR__ . '/fixtures/core_renderer/before_standard_footer_html_generation_callbacks.php');
|
122 |
require_once(__DIR__ . '/fixtures/core_renderer/before_standard_footer_html_generation_callbacks.php');
|
| Línea 135... |
Línea 135... |
| 135 |
$this->assertIsString($html);
|
135 |
$this->assertIsString($html);
|
| 136 |
$this->assertStringContainsString('A heading can be added', $html);
|
136 |
$this->assertStringContainsString('A heading can be added', $html);
|
| 137 |
}
|
137 |
}
|
| Línea 138... |
Línea 138... |
| 138 |
|
138 |
|
| 139 |
/**
|
139 |
/**
|
| 140 |
* @covers \core\hook\after_standard_main_region_html_generation
|
140 |
* @covers \core\hook\output\after_standard_main_region_html_generation
|
| 141 |
*/
|
141 |
*/
|
| 142 |
public function test_after_standard_main_region_html_generation(): void {
|
142 |
public function test_after_standard_main_region_html_generation(): void {
|
| 143 |
$page = new moodle_page();
|
143 |
$page = new moodle_page();
|
| Línea 147... |
Línea 147... |
| 147 |
$this->assertIsString($html);
|
147 |
$this->assertIsString($html);
|
| 148 |
$this->assertStringNotContainsString('A heading can be added', $html);
|
148 |
$this->assertStringNotContainsString('A heading can be added', $html);
|
| 149 |
}
|
149 |
}
|
| Línea 150... |
Línea 150... |
| 150 |
|
150 |
|
| 151 |
/**
|
151 |
/**
|
| 152 |
* @covers \core\hook\after_standard_main_region_html_generation
|
152 |
* @covers \core\hook\output\after_standard_main_region_html_generation
|
| 153 |
*/
|
153 |
*/
|
| 154 |
public function test_after_standard_main_region_html_generation_hooked(): void {
|
154 |
public function test_after_standard_main_region_html_generation_hooked(): void {
|
| Línea 155... |
Línea 155... |
| 155 |
require_once(__DIR__ . '/fixtures/core_renderer/after_standard_main_region_html_generation_callbacks.php');
|
155 |
require_once(__DIR__ . '/fixtures/core_renderer/after_standard_main_region_html_generation_callbacks.php');
|
| Línea 168... |
Línea 168... |
| 168 |
$this->assertIsString($html);
|
168 |
$this->assertIsString($html);
|
| 169 |
$this->assertStringContainsString('A heading can be added', $html);
|
169 |
$this->assertStringContainsString('A heading can be added', $html);
|
| 170 |
}
|
170 |
}
|
| Línea 171... |
Línea 171... |
| 171 |
|
171 |
|
| 172 |
/**
|
172 |
/**
|
| 173 |
* @covers \core\hook\before_html_attributes
|
173 |
* @covers \core\hook\output\before_html_attributes
|
| 174 |
*/
|
174 |
*/
|
| 175 |
public function test_htmlattributes(): void {
|
175 |
public function test_htmlattributes(): void {
|
| 176 |
$page = new moodle_page();
|
176 |
$page = new moodle_page();
|
| Línea 180... |
Línea 180... |
| 180 |
$this->assertIsString($attributes);
|
180 |
$this->assertIsString($attributes);
|
| 181 |
$this->assertStringNotContainsString('data-test="test"', $attributes);
|
181 |
$this->assertStringNotContainsString('data-test="test"', $attributes);
|
| 182 |
}
|
182 |
}
|
| Línea 183... |
Línea 183... |
| 183 |
|
183 |
|
| 184 |
/**
|
184 |
/**
|
| 185 |
* @covers \core\hook\before_html_attributes
|
185 |
* @covers \core\hook\output\before_html_attributes
|
| 186 |
*/
|
186 |
*/
|
| 187 |
public function test_htmlattributes_hooked(): void {
|
187 |
public function test_htmlattributes_hooked(): void {
|
| Línea 188... |
Línea 188... |
| 188 |
require_once(__DIR__ . '/fixtures/core_renderer/htmlattributes_callbacks.php');
|
188 |
require_once(__DIR__ . '/fixtures/core_renderer/htmlattributes_callbacks.php');
|