From 81e5fda87626dfe94d46be511ebc546076b1975b Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Wed, 13 Jan 2021 16:13:25 +0100 Subject: Unified brace and else if style --- test/exec.t | 3 ++- test/getopt.t | 3 ++- test/it_html.t | 3 +-- test/it_url.testserver.php | 3 ++- test/it_url_server.php | 6 ++++-- 5 files changed, 11 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/exec.t b/test/exec.t index 293ad61..5f78482 100755 --- a/test/exec.t +++ b/test/exec.t @@ -62,7 +62,8 @@ is( "... short option without dashes" ); -foreach (["", "C", "de_CH", "de_CH.utf8"] as $locale) { +foreach (["", "C", "de_CH", "de_CH.utf8"] as $locale) +{ setlocale(LC_ALL, $locale); $arg = "preüpost"; if (it::match('utf8', $locale)) diff --git a/test/getopt.t b/test/getopt.t index 48f7d9d..77e52ae 100755 --- a/test/getopt.t +++ b/test/getopt.t @@ -18,7 +18,8 @@ function getopt_ok($argv, $exp, $name) return is($got, $exp, $name); } -foreach (["" => "blah gnaber", " (umlaute)" => "pre üäpost"] as $variant => $testarg) { +foreach (["" => "blah gnaber", " (umlaute)" => "pre üäpost"] as $variant => $testarg) +{ $exp = ['args' => [], 'positional' => $testarg, 'argument' => $testarg, 'default' => 'defäult']; getopt_ok([$testarg, '-a', $testarg], $exp, "Short version" . $variant); getopt_ok([$testarg, '--argument', $testarg], $exp, "Long version with space" . $variant); diff --git a/test/it_html.t b/test/it_html.t index a43f674..aa734c0 100755 --- a/test/it_html.t +++ b/test/it_html.t @@ -253,9 +253,8 @@ is( 'empty tags removal' ); -foreach (json_decode(it::file_get_contents(dirname($argv[0]) . '/U_tests.json'), true) as $test) { +foreach (json_decode(it::file_get_contents(dirname($argv[0]) . '/U_tests.json'), true) as $test) is(U(...$test['args']), $test['exp'], $test['name']); -} is(it_html::entity_decode("ä"), "ä"); is(it_html::entity_decode("J"), "J"); diff --git a/test/it_url.testserver.php b/test/it_url.testserver.php index f02b316..2d1bca4 100644 --- a/test/it_url.testserver.php +++ b/test/it_url.testserver.php @@ -52,7 +52,8 @@ switch ($_SERVER['PHP_SELF']) break; case "/slow_response": - for ($i = 0; $i < 6; $i++) { + for ($i = 0; $i < 6; $i++) + { sleep(1); echo "Testserver slow output $i\n"; } diff --git a/test/it_url_server.php b/test/it_url_server.php index d8049b1..b113be1 100644 --- a/test/it_url_server.php +++ b/test/it_url_server.php @@ -14,13 +14,15 @@ register_shutdown_function( usleep(100000); stream_set_blocking($pipes[2], 0); -function server_output() { +function server_output() +{ $result = array(); while (($result[] = trim(fgets($GLOBALS['pipes'][2])))) {}; return array_filter($result); } -function handle_server($args) { +function handle_server($args) +{ $res = true; foreach ((array)$args as $arg) $res = $res && $arg; -- cgit v1.2.3