public function markIsResolvingFixture(string $id)
{
$this->resolving->add($id);
$this->resolving->checkForCircularReference($id);
}
public function testThrowsAnExceptionWhenACircularReferenceIsDetected() { $context = new GenerationContext(); $context->markIsResolvingFixture('bar'); $context->markIsResolvingFixture('foo'); try { $context->markIsResolvingFixture('foo'); $this->fail('Expected exception to be thrown.'); } catch (CircularReferenceException $exception) { $this->assertEquals('Circular reference detected for the parameter "foo" while resolving ["bar", "foo"].', $exception->getMessage()); } }