diff --git a/libraries/File.class.php b/libraries/File.class.php index 5a6d59f834..332c8ea2ac 100644 --- a/libraries/File.class.php +++ b/libraries/File.class.php @@ -643,7 +643,7 @@ class PMA_File break; } - + return true; } function getCharset() diff --git a/test/classes/PMA_File_test.php b/test/classes/PMA_File_test.php new file mode 100644 index 0000000000..b43135cc4e --- /dev/null +++ b/test/classes/PMA_File_test.php @@ -0,0 +1,59 @@ + +assertEquals($mime, $arr->getCompression()); + } + + /** + * @dataProvider compressedFiles + */ + public function testContent($file, $mime) + { + $orig = file_get_contents('./test/test_data/test.file'); + $file = new PMA_File($file); + $file->setDecompressContent(true); + $this->assertTrue($file->open()); + if ($mime == 'application/zip') { + $this->assertEquals($orig, $file->content_uncompressed); + } else { + $this->assertEquals($orig, $file->getNextChunk()); + } + } + + public function compressedFiles() { + return array( + array('./test/test_data/test.gz', 'application/gzip'), + array('./test/test_data/test.bz2', 'application/bzip2'), + array('./test/test_data/test.zip', 'application/zip'), + ); + } +} +?> diff --git a/test/libraries/PMA_List_Database_test.php b/test/classes/PMA_List_Database_test.php similarity index 97% rename from test/libraries/PMA_List_Database_test.php rename to test/classes/PMA_List_Database_test.php index 00691e818a..6eb3e7e5cc 100644 --- a/test/libraries/PMA_List_Database_test.php +++ b/test/classes/PMA_List_Database_test.php @@ -1,7 +1,7 @@