-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw ValueError on empty tag in enchant_broker_request_dict()
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
ext/enchant/tests/broker_request_dict_error_on_empty_tag.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--TEST-- | ||
enchant_broker_request_dict() must throw ValueError on empty tag | ||
--SKIPIF-- | ||
<?php | ||
if(!extension_loaded('enchant')) die('skip, enchant not loader'); | ||
if (!is_object(enchant_broker_init())) {die("skip, resource dont load\n");} | ||
?> | ||
--FILE-- | ||
<?php | ||
$broker = enchant_broker_init(); | ||
|
||
try { | ||
var_dump(enchant_broker_request_dict($broker, '')); | ||
} catch (\ValueError $e) { | ||
echo $e->getMessage() . \PHP_EOL; | ||
} | ||
|
||
?> | ||
--EXPECT-- | ||
enchant_broker_request_dict(): Argument #2 ($tag) cannot be empty |