Author: Thomas Müller (t_mueller_stolzenhain@yahoo.de)
Inheritance: extends Exceptio\Exception
 /**
  *
  */
 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());
 }
Ejemplo n.º 2
0
 /**
  * @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);
 }