expectException(InvalidArgumentException::class); IOFactory::identify('/non/existing/file'); } public function testIdentifyExistingDirectoryThrowExceptions(): void { $this->expectException(InvalidArgumentException::class); IOFactory::identify('.'); } public function testRegisterInvalidWriter(): void { $this->expectException(\PhpOffice\PhpSpreadsheet\Writer\Exception::class); IOFactory::registerWriter('foo', 'bar'); } public function testRegisterInvalidReader(): void { $this->expectException(\PhpOffice\PhpSpreadsheet\Reader\Exception::class); IOFactory::registerReader('foo', 'bar'); } }