Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Friedman <[email protected]>
  • Loading branch information
iMattPro committed Sep 22, 2023
1 parent 27ee01e commit 5211be5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/acp/module_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,14 @@ public function test_save_google_fonts($input, $expected, $error)

$this->request->expects(self::at(6))
->method('variable')
->with('abbc3_google_fonts', '')
->willReturn($input);
->willReturnMap([
['abbc3_bbcode_bar', 0, false, \phpbb\request\request_interface::REQUEST, 0],
['abbc3_qr_bbcodes', 0, false, \phpbb\request\request_interface::REQUEST, 0],
['abbc3_auto_video', 0, false, \phpbb\request\request_interface::REQUEST, 0],
['abbc3_icons_type', 'png', false, \phpbb\request\request_interface::REQUEST, 'png'],
['abbc3_pipes', 0, false, \phpbb\request\request_interface::REQUEST, 0],
['abbc3_google_fonts', '', false, \phpbb\request\request_interface::REQUEST, $input],
]);

// Throws Notice in PHP 8.0+ and Error in earlier versions
$exceptionName = PHP_VERSION_ID < 80000 ? \PHPUnit\Framework\Error\Error::class : $error;
Expand All @@ -217,7 +223,7 @@ public function test_info()

/**
* Mock check_form_key()
* Note: use the same namespace as the admin_input
* Note: use the same namespace as the controller
*
* @return bool
*/
Expand All @@ -228,7 +234,7 @@ function check_form_key()

/**
* Mock add_form_key()
* Note: use the same namespace as the admin_input
* Note: use the same namespace as the controller
*/
function add_form_key()
{
Expand Down

0 comments on commit 5211be5

Please sign in to comment.