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