function FailureMarkerTest::testExceptionForInvalidYaml
Tests that an exception is thrown if the marker file contains invalid YAML.
@legacy-covers ::assertNotExists
File
- 
              core/
modules/ package_manager/ tests/ src/ Kernel/ FailureMarkerTest.php, line 76  
Class
Namespace
Drupal\Tests\package_manager\KernelCode
public function testExceptionForInvalidYaml() : void {
  $failure_marker = $this->container
    ->get(FailureMarker::class);
  // Write the failure marker with invalid YAML.
  file_put_contents($failure_marker->getPath(), 'message : something message : something1');
  $this->expectException(FailureMarkerExistsException::class);
  $this->expectExceptionMessage('Failure marker file exists but cannot be decoded.');
  $failure_marker->assertNotExists();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.