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 Nov 7, 2024
1 parent 9479d0c commit dac619a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/acp/acp_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ public function test_main_save_error()
public function save_google_fonts_data()
{
return [
['', '[]', E_USER_NOTICE, 'CONFIG_UPDATED'],
['', '', E_USER_NOTICE, 'CONFIG_UPDATED'],
['Droid Sans', '["Droid Sans"]', E_USER_NOTICE, 'CONFIG_UPDATED'],
["Droid Sans\nRoboto", '["Droid Sans","Roboto"]', E_USER_NOTICE, 'CONFIG_UPDATED'],
["Droid Sans\nRoboto\nMac Donald", '["Droid Sans","Roboto"]', E_USER_WARNING, 'ABBC3_INVALID_FONT'],
['Mac Donald', '[]', E_USER_WARNING, 'ABBC3_INVALID_FONT'],
['Mac Donald', '', E_USER_WARNING, 'ABBC3_INVALID_FONT'],
];
}

Expand Down Expand Up @@ -214,13 +214,13 @@ public function test_save_google_fonts($input, $expected, $error, $error_message
['abbc3_google_fonts', '', false, \phpbb\request\request_interface::REQUEST, $input],
]);

$this->expectException('\RuntimeException');
$this->expectExceptionCode($error);
$this->expectExceptionMessage($error_message);

$this->acp_controller->handle();

$this->assertSame($expected, $this->config_text->get('abbc3_google_fonts'));
try {
$this->acp_controller->handle();
} catch (\RuntimeException $e) {
$this->assertSame($expected, $this->config_text->get('abbc3_google_fonts'));
$this->assertEquals($error, $e->getCode());
$this->assertEquals($error_message, $e->getMessage());
}
}

public function test_info()
Expand Down

0 comments on commit dac619a

Please sign in to comment.