configuration = new Configuration(); $this->configuration->setUseCachedMetas(false); $this->configuration->silentOnError(true); $this->builder = new Builder(new Kernel($this->configuration)); } public function testInvalidReference(): void { $this->expectException(Throwable::class); $this->expectExceptionMessage('Found invalid reference "does_not_exist" in file "index"'); $this->builder->build($this->sourceFile(), $this->targetFile()); } public function testInvalidReferenceIgnored(): void { $this->configuration->setIgnoreInvalidReferences(true); $this->builder->build($this->sourceFile(), $this->targetFile()); $contents = $this->getFileContents($this->targetFile('index.html')); self::assertStringContainsString('
Test unresolved reference
', $contents); } protected function getFixturesDirectory(): string { return 'BuilderInvalidReferences'; } }