Nelmio\Alice\Generator\GenerationContext::markIsResolvingFixture PHP Method

markIsResolvingFixture() public method

public markIsResolvingFixture ( string $id )
$id string
    public function markIsResolvingFixture(string $id)
    {
        $this->resolving->add($id);
        $this->resolving->checkForCircularReference($id);
    }

Usage Example

Example #1
0
 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());
     }
 }
All Usage Examples Of Nelmio\Alice\Generator\GenerationContext::markIsResolvingFixture