Skip to content

Commit 4eb9764

Browse files
committed
Fix unit tests after cleaning up builtin snippets
1 parent 3fac0f4 commit 4eb9764

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/snippets_test.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ final class snippets_test extends advanced_testcase {
3838
* @return void
3939
*/
4040
public function test_parse_snippet_header(): void {
41-
$meta = snippets::get_snippet_meta('visual-depth.scss', 'theme_boost_union');
41+
$meta = snippets::get_snippet_meta('visual_depth.scss', 'theme_boost_union');
4242
$this->assertEquals('Visual depth', $meta->title);
4343
$this->assertEquals('global', $meta->scope);
4444
$this->assertEquals('eyecandy', $meta->goal);
4545
$this->assertEquals(
46-
'A less flat design than is intended in the Boost theme. Realised by ' .
46+
'A less flat design than the original Boost theme. Realized with ' .
4747
'box-shadows on a number of page elements and a colour gradient on the page background.',
4848
$meta->description
4949
);
@@ -80,7 +80,7 @@ public function test_register_builtin_snippets(): void {
8080
// Delete one snippet from the database.
8181
$DB->delete_records(
8282
'theme_boost_union_snippets',
83-
['source' => 'theme_boost_union', 'path' => 'visual-depth.scss']
83+
['source' => 'theme_boost_union', 'path' => 'visual_depth.scss']
8484
);
8585

8686
$count = $DB->count_records(
@@ -96,7 +96,7 @@ public function test_register_builtin_snippets(): void {
9696
// The builtin snippet which was just deleted from the db should be registered again.
9797
$snippet = $DB->get_record(
9898
'theme_boost_union_snippets',
99-
['source' => 'theme_boost_union', 'path' => 'visual-depth.scss']
99+
['source' => 'theme_boost_union', 'path' => 'visual_depth.scss']
100100
);
101101

102102
$this->assertNotEmpty($snippet);
@@ -145,7 +145,7 @@ public function test_fetch_enabled_snippets_scss(): void {
145145
// Enable a builtin snippet directly via the DB.
146146
$snippet = $DB->get_record(
147147
'theme_boost_union_snippets',
148-
['source' => 'theme_boost_union', 'path' => 'visual-depth.scss']
148+
['source' => 'theme_boost_union', 'path' => 'visual_depth.scss']
149149
);
150150
$snippet->enabled = 1;
151151
$DB->update_record('theme_boost_union_snippets', $snippet);
@@ -168,9 +168,9 @@ public function test_fetch_enabled_snippets_scss(): void {
168168
public function test_lookup_visual_preview_file(): void {
169169
global $CFG;
170170

171-
$file = snippets::get_snippet_preview_url('international_day_against_homophobia.scss', 'theme_boost_union');
171+
$file = snippets::get_snippet_preview_url('rainbow_navbar.scss', 'theme_boost_union');
172172

173173
// Check that indeed the present webp preview for this snippet is returned.
174-
$this->assertEquals($CFG->wwwroot . '/theme/boost_union/snippets/builtin/international_day_against_homophobia.webp', $file);
174+
$this->assertEquals($CFG->wwwroot . '/theme/boost_union/snippets/builtin/rainbow_navbar.webp', $file);
175175
}
176176
}

0 commit comments

Comments
 (0)