diff options
author | Nathan Gass | 2012-10-15 17:47:39 +0000 |
---|---|---|
committer | Nathan Gass | 2012-10-15 17:47:39 +0000 |
commit | 6cca63fafdfa80bcc1e56e1e91b1b2492b34e018 (patch) | |
tree | c0f8072ad79bd7e2cf0a8067dac21d4f8e7cb78a | |
parent | 874e0c2a05d9ad38ee495301ca366b67d13d77dd (diff) | |
download | itools-6cca63fafdfa80bcc1e56e1e91b1b2492b34e018.tar.gz itools-6cca63fafdfa80bcc1e56e1e91b1b2492b34e018.tar.bz2 itools-6cca63fafdfa80bcc1e56e1e91b1b2492b34e018.zip |
group all redirect tests together, remove commented out code
-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); |