Nelmio\Alice\Generator\GenerationContextTest::testThrowsAnExceptionWhenACircularReferenceIsDetected PHP Method

testThrowsAnExceptionWhenACircularReferenceIsDetected() public method

    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());
        }
    }