/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/php/catches_strings_runme.php
23 строки
646 B
Olly Betts
catches_strings_runme.php: Check exact exception message
24 апр 2023, 06:15
24 апр 2023, 06:15
d9aeb01
Код
Авторство
О чём код?
<?php require "tests.php"; $exception_thrown = false; try { StringsThrower::charstring(); } catch (Exception $e) { check::equal($e->getMessage(), "charstring message", "incorrect exception message: {$e->getMessage()}"); $exception_thrown = true; } check::equal($exception_thrown, true, "Should have thrown an exception"); $exception_thrown = false; try { StringsThrower::stdstring(); } catch (Exception $e) { check::equal($e->getMessage(), "stdstring message", "incorrect exception message: {$e->getMessage()}"); $exception_thrown = true; } check::equal($exception_thrown, true, "Should have thrown an exception"); check::done();