You are here

public function FetcherResultTest::testNonWritableFile in Feeds 8.3

@covers ::getFilePath

File

tests/src/Unit/Result/FetcherResultTest.php, line 65

Class

FetcherResultTest
@coversDefaultClass \Drupal\feeds\Result\FetcherResult @group feeds

Namespace

Drupal\Tests\feeds\Unit\Result

Code

public function testNonWritableFile() {
  file_put_contents('vfs://feeds/test_file', pack('CCC', 0xef, 0xbb, 0xbf) . 'I am test data.');
  chmod('vfs://feeds/test_file', 0444);
  $result = new FetcherResult('vfs://feeds/test_file');
  $this
    ->expectException(RuntimeException::class);
  $result
    ->getFilePath();
}