From 288eedf6a1ec1c200b1d61c396d9fa3ce302e162 Mon Sep 17 00:00:00 2001
From: the-djmaze <>
Date: Wed, 22 Nov 2023 12:52:43 +0100
Subject: [PATCH] Improved test output with colors
---
.../app/libraries/snappymail/integrity.php | 22 ++++++++++++++-----
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/integrity.php b/snappymail/v/0.0.0/app/libraries/snappymail/integrity.php
index 90ad4ce86..752769226 100644
--- a/snappymail/v/0.0.0/app/libraries/snappymail/integrity.php
+++ b/snappymail/v/0.0.0/app/libraries/snappymail/integrity.php
@@ -41,9 +41,9 @@ abstract class Integrity
echo 'Status: ' . $response->status . '
' . \print_r($response->headers, 1) . '
';
$size = \filesize(APP_VERSION_ROOT_PATH.$file);
if ($size == intval($response->getHeader('content-length'))) {
- echo 'content-length matches size ' . $size;
+ echo '
content-length matches size ' . $size . '
';
} else {
- echo 'content-length mismatch, should be ' . $size;
+ echo 'content-length mismatch, should be: ' . $size . '
';
}
/*
echo "encoding
";
@@ -55,9 +55,14 @@ abstract class Integrity
echo 'Status: ' . $response->status . '
' . \print_r($response->headers, 1) . '
';
$size = \filesize(APP_VERSION_ROOT_PATH.$file . '.gz');
if ($size == intval($response->getHeader('content-length'))) {
- echo 'content-length matches size ' . $size;
+ echo 'content-length matches size ' . $size . '
';
} else {
- echo 'content-length mismatch, should be ' . $size;
+ echo 'content-length mismatch, should be: ' . $size . '
';
+ }
+ if ('gzip' == $response->getHeader('content-encoding')) {
+ echo 'content-encoding matches
';
+ } else {
+ echo 'content-encoding mismatch, should be: gzip
';
}
echo "brotli encoded
";
@@ -65,9 +70,14 @@ abstract class Integrity
echo 'Status: ' . $response->status . '
' . \print_r($response->headers, 1) . '
';
$size = \filesize(APP_VERSION_ROOT_PATH.$file . '.br');
if ($size == intval($response->getHeader('content-length'))) {
- echo 'content-length matches size ' . $size;
+ echo 'content-length matches size ' . $size . '
';
} else {
- echo 'content-length mismatch, should be ' . $size;
+ echo 'content-length mismatch, should be: ' . $size . '
';
+ }
+ if ('br' == $response->getHeader('content-encoding')) {
+ echo 'content-encoding matches
';
+ } else {
+ echo 'content-encoding mismatch, should be: br
';
}
}
}