Skip to content

Commit 6f1287f

Browse files
committed
tests: fixes
1 parent a6282f5 commit 6f1287f

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

tests/Http.DI/HttpExtension.csp.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ preg_match('#nonce-([\w+/]+=*)#', implode($headers), $nonce);
5454
Assert::contains("Content-Security-Policy: default-src 'self' https://example.com; upgrade-insecure-requests; script-src 'nonce-$nonce[1]'; style-src 'self' https://example.com http:; require-sri-for style; sandbox allow-forms; plugin-types application/x-java-applet;", $headers);
5555
Assert::contains("Content-Security-Policy-Report-Only: default-src 'nonce-$nonce[1]'; report-uri https://example.com/report; upgrade-insecure-requests;", $headers);
5656

57-
58-
echo ' '; @ob_flush(); flush();
57+
// flush buffers
58+
echo str_repeat(' ', ini_get('output_buffering') + 1);
5959

6060
Assert::true(headers_sent());
6161

tests/Http.DI/HttpExtension.featurePolicy.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ var_dump($headers);
4343
Assert::contains("Feature-Policy: unsized-media 'none'; geolocation 'self' https://example.com; camera *;", $headers);
4444

4545

46-
echo ' '; @ob_flush(); flush();
46+
// flush buffers
47+
echo str_repeat(' ', ini_get('output_buffering') + 1);
4748

4849
Assert::true(headers_sent());
4950

tests/Http.DI/HttpExtension.headers.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ Assert::contains('D: 0', $headers);
4444
Assert::notContains('C:', $headers);
4545

4646

47-
echo ' '; @ob_flush(); flush();
47+
// flush buffers
48+
echo str_repeat(' ', ini_get('output_buffering') + 1);
4849

4950
Assert::true(headers_sent());
5051

tests/Http/Response.error.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/**
44
* Test: Nette\Http\Response errors.
5+
* @phpIni output_buffering=0
56
*/
67

78
declare(strict_types=1);

0 commit comments

Comments
 (0)