Files
PhpSpreadsheet/tests/PhpSpreadsheetTests/Reader/Xlsx/OctothorpeTest.php
oleibman d5825a6682 Read Spreadsheet with # in Name (#2409)
Fix #2405. Treat last, rather than first, `#` as separator between zip file name and member name, by finding it with strrpos rather than strpos.
2021-11-30 07:39:50 -08:00

21 lines
597 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PHPUnit\Framework\TestCase;
class OctothorpeTest extends TestCase
{
public function testOctothorpeInName(): void
{
// Permit # in file name.
$filename = 'tests/data/Reader/XLSX/octo#thorpe.xlsx';
$reader = IOFactory::createReader('Xlsx');
$spreadsheet = $reader->load($filename);
$sheet = $spreadsheet->getActiveSheet();
self::assertSame('xyz', $sheet->getCell('A1')->getValue());
$spreadsheet->disconnectWorksheets();
}
}