* adding tests
[m6w6/ext-http] / tests / 022_redirect.phpt
diff --git a/tests/022_redirect.phpt b/tests/022_redirect.phpt
new file mode 100644 (file)
index 0000000..bd9a23d
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+http_redirect() permanent
+--SKIPIF--
+<?php 
+extension_loaded('http') or die('ext/http not available');
+strncasecmp(PHP_SAPI, 'CLI', 3) or die('cannot run tests with CLI');
+?>
+--FILE--
+<?php
+http_redirect('redirect', null, false, true);
+?>
+--EXPECTF--
+Status: 301
+Content-type: text/html
+X-Powered-By: PHP/%s
+Location: http://localhost/redirect
+
+Redirecting to <a href="http://localhost/redirect">http://localhost/redirect</a>.
+