Commit b2912b13 authored by mark burdett's avatar mark burdett
Browse files

Issue #3276224 by mfb: Test failed to open stream handling

parent 66b19b6c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -196,4 +196,14 @@ class FileHashTest extends KernelTestBase implements FileHashTestInterface {
    $file->delete();
  }

  /**
   * Tests that a warning is logged if nonexistent file is hashed.
   */
  public function testNonexistentFile() {
    $this->expectWarning();
    // "Failed" on PHP 8 or "failed" on PHP 7.
    $this->expectWarningMessage('ailed to open stream');
    File::create(['uri' => "temporary://{$this->randomMachineName()}.txt"]);
  }

}