mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Improved test output with colors
This commit is contained in:
parent
3bff3555a0
commit
288eedf6a1
1 changed files with 16 additions and 6 deletions
|
|
@ -41,9 +41,9 @@ abstract class Integrity
|
||||||
echo '<details><summary>Status: ' . $response->status . '</summary><pre>' . \print_r($response->headers, 1) . '</pre></details>';
|
echo '<details><summary>Status: ' . $response->status . '</summary><pre>' . \print_r($response->headers, 1) . '</pre></details>';
|
||||||
$size = \filesize(APP_VERSION_ROOT_PATH.$file);
|
$size = \filesize(APP_VERSION_ROOT_PATH.$file);
|
||||||
if ($size == intval($response->getHeader('content-length'))) {
|
if ($size == intval($response->getHeader('content-length'))) {
|
||||||
echo 'content-length matches size ' . $size;
|
echo '<div>content-length matches size ' . $size . '</div>';
|
||||||
} else {
|
} else {
|
||||||
echo 'content-length mismatch, should be ' . $size;
|
echo '<div style="color: red">content-length mismatch, should be: ' . $size . '</div>';
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
echo "<h3>encoding</h3>";
|
echo "<h3>encoding</h3>";
|
||||||
|
|
@ -55,9 +55,14 @@ abstract class Integrity
|
||||||
echo '<details><summary>Status: ' . $response->status . '</summary><pre>' . \print_r($response->headers, 1) . '</pre></details>';
|
echo '<details><summary>Status: ' . $response->status . '</summary><pre>' . \print_r($response->headers, 1) . '</pre></details>';
|
||||||
$size = \filesize(APP_VERSION_ROOT_PATH.$file . '.gz');
|
$size = \filesize(APP_VERSION_ROOT_PATH.$file . '.gz');
|
||||||
if ($size == intval($response->getHeader('content-length'))) {
|
if ($size == intval($response->getHeader('content-length'))) {
|
||||||
echo 'content-length matches size ' . $size;
|
echo '<div>content-length matches size ' . $size . '</div>';
|
||||||
} else {
|
} else {
|
||||||
echo 'content-length mismatch, should be ' . $size;
|
echo '<div style="color: red">content-length mismatch, should be: ' . $size . '</div>';
|
||||||
|
}
|
||||||
|
if ('gzip' == $response->getHeader('content-encoding')) {
|
||||||
|
echo '<div>content-encoding matches</div>';
|
||||||
|
} else {
|
||||||
|
echo '<div style="color: red">content-encoding mismatch, should be: gzip</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<h3>brotli encoded</h3>";
|
echo "<h3>brotli encoded</h3>";
|
||||||
|
|
@ -65,9 +70,14 @@ abstract class Integrity
|
||||||
echo '<details><summary>Status: ' . $response->status . '</summary><pre>' . \print_r($response->headers, 1) . '</pre></details>';
|
echo '<details><summary>Status: ' . $response->status . '</summary><pre>' . \print_r($response->headers, 1) . '</pre></details>';
|
||||||
$size = \filesize(APP_VERSION_ROOT_PATH.$file . '.br');
|
$size = \filesize(APP_VERSION_ROOT_PATH.$file . '.br');
|
||||||
if ($size == intval($response->getHeader('content-length'))) {
|
if ($size == intval($response->getHeader('content-length'))) {
|
||||||
echo 'content-length matches size ' . $size;
|
echo '<div>content-length matches size ' . $size . '</div>';
|
||||||
} else {
|
} else {
|
||||||
echo 'content-length mismatch, should be ' . $size;
|
echo '<div style="color: red">content-length mismatch, should be: ' . $size . '</div>';
|
||||||
|
}
|
||||||
|
if ('br' == $response->getHeader('content-encoding')) {
|
||||||
|
echo '<div>content-encoding matches</div>';
|
||||||
|
} else {
|
||||||
|
echo '<div style="color: red">content-encoding mismatch, should be: br</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue