Пример #1
0
 /**
  * @expectedException \RuntimeException
  */
 public function testNonReadableFile()
 {
     file_put_contents('vfs://feeds/test_file', 'I am test data.');
     chmod('vfs://feeds/test_file', 00);
     $result = new FetcherResult('vfs://feeds/test_file');
     $result->getRaw();
 }
Пример #2
0
 /**
  * @expectedException \RuntimeException
  */
 public function testGetRaw()
 {
     file_put_contents(static::FILE, pack('CCC', 0xef, 0xbb, 0xbf) . 'I am test data.');
     $result = new FetcherResult(static::FILE);
     $this->assertSame('I am test data.', $result->getRaw());
     // Throws exception.
     $result = new FetcherResult('IDONTEXIST');
     $result->getRaw();
 }