summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/bug68532.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/file/bug68532.phpt')
-rw-r--r--ext/standard/tests/file/bug68532.phpt25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/standard/tests/file/bug68532.phpt b/ext/standard/tests/file/bug68532.phpt
new file mode 100644
index 0000000000..7d1a0cea9a
--- /dev/null
+++ b/ext/standard/tests/file/bug68532.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #68532: convert.base64-encode omits padding bytes
+--FILE--
+<?php
+$testString = 'test';
+$stream = fopen('php://memory','r+');
+fwrite($stream, $testString);
+rewind($stream);
+$filter = stream_filter_append($stream, 'convert.base64-encode');
+echo "memoryStream = " . stream_get_contents($stream).PHP_EOL;
+
+
+$fileStream = fopen(__DIR__ . '/base64test.txt','w+');
+fwrite($fileStream , $testString);
+rewind($fileStream );
+$filter = stream_filter_append($fileStream , 'convert.base64-encode');
+echo "fileStream = " . stream_get_contents($fileStream ).PHP_EOL;
+?>
+--CLEAN--
+<?php
+unlink(__DIR__ . '/base64test.txt');
+?>
+--EXPECT--
+memoryStream = dGVzdA==
+fileStream = dGVzdA==