-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Xls file threw exception during open by Xls reader
- Loading branch information
Showing
8 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace PhpOffice\PhpSpreadsheetTests\Reader; | ||
|
||
use PhpOffice\PhpSpreadsheet\Reader\Xls; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class XlsTest extends TestCase | ||
{ | ||
/** | ||
* Test load Xls file. | ||
*/ | ||
public function testLoadXlsSample() | ||
{ | ||
$filename = './data/Reader/XLS/sample.xls'; | ||
$reader = new Xls(); | ||
$spreadsheet = $reader->load($filename); | ||
self::assertEquals('Title', $spreadsheet->getSheet(0)->getCell('A1')->getValue()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace PhpOffice\PhpSpreadsheetTests\Shared; | ||
|
||
use PhpOffice\PhpSpreadsheet\Shared\OLERead; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class OLEReadTest extends TestCase | ||
{ | ||
public function testReadOleStreams() | ||
{ | ||
$dataDir = './data/Shared/OLERead/'; | ||
$ole = new OLERead(); | ||
$ole->read('./data/Reader/XLS/sample.xls'); | ||
self::assertEquals( | ||
file_get_contents($dataDir . 'wrkbook'), | ||
$ole->getStream($ole->wrkbook) | ||
); | ||
self::assertEquals( | ||
file_get_contents($dataDir . 'summary'), | ||
$ole->getStream($ole->summaryInformation) | ||
); | ||
self::assertEquals( | ||
file_get_contents($dataDir . 'document'), | ||
$ole->getStream($ole->documentSummaryInformation) | ||
); | ||
} | ||
} |
Binary file not shown.
Empty file.
Empty file.
Binary file not shown.