Skip to content

Commit bcbaf22

Browse files
committed
Cover changes in tests
1 parent c29cf72 commit bcbaf22

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

event/main_listener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static function getSubscribedEvents()
7878
* Constructor
7979
*
8080
* @param auth $auth
81-
* @param config $config
81+
* @param config $config
8282
* @param db_text $config_text
8383
* @param language $language
8484
* @param template $template
@@ -104,7 +104,7 @@ public function __construct(auth $auth, config $config, db_text $config_text, la
104104
*/
105105
public function add_custom_sites($event)
106106
{
107-
$is_phpbb4 = phpbb_version_compare(PHPBB_VERSION, '4.0.0', '>=');
107+
$is_phpbb4 = phpbb_version_compare($this->config['version'], '4.0.0', '>=');
108108
$phpbb4_builtins = array_flip([
109109
'applepodcasts', 'bluesky', 'bunny', 'mastodon', 'pastebin', 'threads', 'twitter',
110110
]);

tests/event/listener_test.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,14 @@ public function test_configure_media_embed($tag, $code, $id, $exists, $parse_url
189189
{
190190
$this->custom_sites->expects(self::once())
191191
->method('get_collection')
192-
->willReturn([__DIR__ . '/../fixtures/sites/ok.yml']);
192+
->willReturn([
193+
__DIR__ . '/../fixtures/sites/ok.yml',
194+
__DIR__ . '/../fixtures/sites/bluesky.yml', // this is to test that phpbb4 filtering works
195+
]);
193196

194197
// Update configs with test values
195198
$this->config['media_embed_parse_urls'] = $parse_urls;
199+
$this->config['version'] = '4.0.0'; // this is to test that phpbb4 filtering works
196200

197201
// Get the s9e configurator
198202
$configurator = $this->container

0 commit comments

Comments
 (0)