Example #1
0
 /**
  * @expectedException \Crossjoin\Browscap\Exception\SourceUnavailableException
  * @expectedExceptionCode 1458977225
  *
  * @throws ParserRuntimeException
  * @throws SourceUnavailableException
  */
 public function testDataSourceUnavailable()
 {
     $iniFile = dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR . 'lite_php_browscap.ini';
     $tmpFile = tempnam(sys_get_temp_dir(), 'cb-');
     file_put_contents($tmpFile, file_get_contents($iniFile));
     $source = new File($tmpFile);
     unlink($tmpFile);
     $content = '';
     foreach ($source->getDataSets() as $dataSet) {
         // do nothing, but this loop is required to really call getData()
         $content .= ' ';
     }
 }