From 6cbde74c254104540782eb97b1fc318a6fc19a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 24 Feb 2014 11:59:41 +0100 Subject: [PATCH 1/2] Test encoded binary output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise PHP sometimes refuses to match binary content using PCRE. Signed-off-by: Michal Čihař --- test/classes/plugin/export/PMA_ExportOds_test.php | 3 ++- test/classes/plugin/export/PMA_ExportOdt_test.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/classes/plugin/export/PMA_ExportOds_test.php b/test/classes/plugin/export/PMA_ExportOds_test.php index 57aceb551f..b8d02f2082 100644 --- a/test/classes/plugin/export/PMA_ExportOds_test.php +++ b/test/classes/plugin/export/PMA_ExportOds_test.php @@ -192,7 +192,8 @@ class PMA_ExportOds_Test extends PHPUnit_Framework_TestCase { $GLOBALS['ods_buffer'] = 'header'; - $this->expectOutputRegex('/^PK.*content.xml/'); + $this->expectOutputRegex('/^504b.*636f6e74656e742e786d6c2f/'); + $this->setOutputCallback('bin2hex'); $this->assertTrue( $this->object->exportFooter() diff --git a/test/classes/plugin/export/PMA_ExportOdt_test.php b/test/classes/plugin/export/PMA_ExportOdt_test.php index ef8d89e706..46f589fa15 100644 --- a/test/classes/plugin/export/PMA_ExportOdt_test.php +++ b/test/classes/plugin/export/PMA_ExportOdt_test.php @@ -333,7 +333,8 @@ class PMA_ExportOdt_Test extends PHPUnit_Framework_TestCase { $GLOBALS['odt_buffer'] = 'header'; - $this->expectOutputRegex('/^PK.*content.xml/'); + $this->expectOutputRegex('/^504b.*636f6e74656e742e786d6c2f/'); + $this->setOutputCallback('bin2hex'); $this->assertTrue( $this->object->exportFooter() From f319824b54bd8c538837496f1ab637554efc5ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 24 Feb 2014 12:26:02 +0100 Subject: [PATCH 2/2] Fix regexp to match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- test/classes/plugin/export/PMA_ExportOds_test.php | 2 +- test/classes/plugin/export/PMA_ExportOdt_test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/classes/plugin/export/PMA_ExportOds_test.php b/test/classes/plugin/export/PMA_ExportOds_test.php index b8d02f2082..f4083a0668 100644 --- a/test/classes/plugin/export/PMA_ExportOds_test.php +++ b/test/classes/plugin/export/PMA_ExportOds_test.php @@ -192,7 +192,7 @@ class PMA_ExportOds_Test extends PHPUnit_Framework_TestCase { $GLOBALS['ods_buffer'] = 'header'; - $this->expectOutputRegex('/^504b.*636f6e74656e742e786d6c2f/'); + $this->expectOutputRegex('/^504b.*636f6e74656e742e786d6c/'); $this->setOutputCallback('bin2hex'); $this->assertTrue( diff --git a/test/classes/plugin/export/PMA_ExportOdt_test.php b/test/classes/plugin/export/PMA_ExportOdt_test.php index 46f589fa15..89aef27234 100644 --- a/test/classes/plugin/export/PMA_ExportOdt_test.php +++ b/test/classes/plugin/export/PMA_ExportOdt_test.php @@ -333,7 +333,7 @@ class PMA_ExportOdt_Test extends PHPUnit_Framework_TestCase { $GLOBALS['odt_buffer'] = 'header'; - $this->expectOutputRegex('/^504b.*636f6e74656e742e786d6c2f/'); + $this->expectOutputRegex('/^504b.*636f6e74656e742e786d6c/'); $this->setOutputCallback('bin2hex'); $this->assertTrue(