diff options
Diffstat (limited to 'tests/it_url.t')
-rwxr-xr-x | tests/it_url.t | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/it_url.t b/tests/it_url.t index e5f5c6b..9b9020c 100755 --- a/tests/it_url.t +++ b/tests/it_url.t @@ -126,7 +126,6 @@ ok( $server = proc_open( 'php -S localhost:8000 ' . dirname($_SERVER['PHP_SELF']) . '/it_url.testserver.php', array(0 => fopen('/dev/null', 'r'), 1 => fopen('/dev/null', 'w'), 2 => array('pipe', 'w')), - //array(0 => fopen('/dev/null', 'r'), 1 => fopen('/dev/null', 'w'), 2 => array(fopen('php://stderr', 'w'))), $pipes ); usleep(100000); @@ -182,28 +181,27 @@ $output = server_output(); if (!$res) diag($output); - $res = ok( - !it_url::get('url' => 'http://localhost:8000/does_not_exist', 'retries' => 4), - 'it_url::get() retries on empty response', + !it_url::get(U('http://localhost:8000/redirect_loop', 'num' => 10)), + 'it_url::get() handles redirect loop', ); $output = server_output(); +$last_num = it::match('num=(\d+)', end($output)); $res2 = ok( - count(preg_grep('/^Got Request:/', $output)) == 5, - 'it_url::get() respects set retry count', + $last_num == 5, + 'it_url::get() aborts redirect loop after 5 redirects', ); if (!$res || !$res2) diag($output); $res = ok( - !it_url::get(U('http://localhost:8000/redirect_loop', 'num' => 10)), - 'it_url::get() handles redirect loop', + !it_url::get('url' => 'http://localhost:8000/does_not_exist', 'retries' => 4), + 'it_url::get() retries on empty response', ); $output = server_output(); -$last_num = it::match('num=(\d+)', end($output)); $res2 = ok( - $last_num == 5, - 'it_url::get() aborts redirect loop after 5 redirects', + count(preg_grep('/^Got Request:/', $output)) == 5, + 'it_url::get() respects set retry count', ); if (!$res || !$res2) diag($output); |