Skip to content

Commit ae66b7f

Browse files
committed
Refactor new lang file name and add functional test
1 parent 5cac594 commit ae66b7f

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

event/main_listener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public function append_agreement()
379379
return;
380380
}
381381

382-
$this->language->add_lang('info_ucp_mediaembed', 'phpbb/mediaembed');
382+
$this->language->add_lang('ucp', 'phpbb/mediaembed');
383383

384384
$this->template->append_var('AGREEMENT_TEXT', $this->language->lang('MEDIA_EMBED_PRIVACY_POLICY', $this->config['sitename']));
385385
}

tests/functional/media_embed_test.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ public function test_acp_modules()
172172
$this->assert_checkbox_is_checked($crawler, 'youtube');
173173
}
174174

175+
public function test_ucp_agreement()
176+
{
177+
$this->add_lang_ext('phpbb/mediaembed', 'ucp');
178+
179+
$crawler = self::request('GET', 'ucp.php?mode=privacy');
180+
$this->assertStringContainsString($this->lang('MEDIA_EMBED_PRIVACY_POLICY', 'yourdomain.com'), $crawler->filter('.agreement')->html());
181+
}
182+
175183
/**
176184
* Override original function to search by checkbox value instead of name
177185
*

0 commit comments

Comments
 (0)