assertEquals($expectedResult, $result); } public function providerCodePage() { return require 'data/Shared/CodePage.php'; } public function testNumberToNameWithInvalidCodePage() { $invalidCodePage = 12345; try { call_user_func([CodePage::class, 'numberToName'], $invalidCodePage); } catch (Exception $e) { $this->assertEquals($e->getMessage(), 'Unknown codepage: 12345'); return; } $this->fail('An expected exception has not been raised.'); } public function testNumberToNameWithUnsupportedCodePage() { $unsupportedCodePage = 720; try { call_user_func([CodePage::class, 'numberToName'], $unsupportedCodePage); } catch (Exception $e) { $this->assertEquals($e->getMessage(), 'Code page 720 not supported.'); return; } $this->fail('An expected exception has not been raised.'); } }