Add catches_strings test to test throws char * typemap
This commit is contained in:
parent
034e2358f9
commit
4a29229bab
21 changed files with 286 additions and 0 deletions
14
Examples/test-suite/php/catches_strings_runme.php
Normal file
14
Examples/test-suite/php/catches_strings_runme.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
require "tests.php";
|
||||
|
||||
$exception_thrown = false;
|
||||
try {
|
||||
StringsThrower::charstring();
|
||||
} catch (Exception $e) {
|
||||
check::str_contains($e->getMessage(), "charstring message", "incorrect exception message: {$e->getMessage()}");
|
||||
$exception_thrown = true;
|
||||
}
|
||||
check::equal($exception_thrown, true, "Should have thrown an exception");
|
||||
|
||||
check::done();
|
||||
Loading…
Add table
Add a link
Reference in a new issue