/** * */ public function testFileNotFound() { /** @var \BrowscapPHP\Exception\FileNotFoundException $exception */ $exception = FileNotFoundException::fileNotFound('test.txt'); self::assertInstanceOf('\\BrowscapPHP\\Exception\\FileNotFoundException', $exception); self::assertSame('File "test.txt" does not exist', $exception->getMessage()); }
/** * @param string $iniFile * @throws \BrowscapPHP\Exception\FileNotFoundException */ public function convertFile($iniFile) { if (!$this->getFilesystem()->exists($iniFile)) { throw FileNotFoundException::fileNotFound($iniFile); } $this->logger->info('start reading file'); $iniString = file_get_contents($iniFile); $this->logger->info('finished reading file'); $this->convertString($iniString); }