Fix XLSX Writer on Windows plaftorms

A bug was introduced, preventing Spout to create valid XLSX files on Windows.
This commits reverts the changes that introduced DIRECTORY_SEPARATOR everywhere
and fixes the original issue with the writer by normalizing paths when creating
the zipped file.
This commit is contained in:
Adrien Loison committed 2015-07-01 15:24:58 -07:00
1 parent c6ebf115fc
commit b3df57d2e5
9 files changed
+29 -38

No files matched your search

+1 -10
View File
@@ -90,18 +90,9 @@ class SheetTest extends \PHPUnit_Framework_TestCase
*/
private function assertSheetNameEquals($expectedName, $resourcePath, $message = '')
{
$pathToWorkbookFile = $resourcePath . $this->normalizePath('#xl/workbook.xml');
$pathToWorkbookFile = $resourcePath . '#xl/workbook.xml';
$xmlContents = file_get_contents('zip://' . $pathToWorkbookFile);
$this->assertContains('<sheet name="' . $expectedName . '"', $xmlContents, $message);
}
/**
* @param string $path
* @return string The path with the correct directory separators, as defined for the current platform
*/
private function normalizePath($path)
{
return str_replace('/', DIRECTORY_SEPARATOR, $path);
}
}