From edf77fd524b1303732dcf24e53f375789631d143 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 25 Sep 2015 13:27:50 +0200 Subject: [PATCH] add missing test --- tests/gh-issue12.phpt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/gh-issue12.phpt diff --git a/tests/gh-issue12.phpt b/tests/gh-issue12.phpt new file mode 100644 index 0000000..0721586 --- /dev/null +++ b/tests/gh-issue12.phpt @@ -0,0 +1,31 @@ +--TEST-- +crash with bad url passed to http\Message::setRequestUrl() +--SKIPIF-- + +--FILE-- +setRequestUrl($url); + printf("OK: %s\n", $url); + } catch (Exception $e) { + printf("%s\n", $e->getMessage()); + } +} + +?> +===DONE=== +--EXPECT-- +Test +http\Message::setRequestUrl(): Failed to parse host; unexpected '.' at pos 0 in '.foo.bar' +http\Message::setRequestUrl(): Failed to parse host; unexpected '.' at pos 4 in 'foo..bar' +OK: http://foo.bar. +===DONE=== -- 2.30.2