/** * {@inheritdoc} */ public function requireOnce(string $path) { if (!is_file($path)) { throw FileNotFoundException::fromPath($path); } require_once $path; }
public function test_that_from_path_returns_expected_instance() { $exception = FileNotFoundException::fromPath('/tmp/file.txt'); $this->assertSame('File not found: /tmp/file.txt', $exception->getMessage()); }