isFirstPass() public method

public isFirstPass ( ) : boolean
return boolean
Exemplo n.º 1
0
 public function testAccessors()
 {
     $context = new GenerationContext();
     $this->assertTrue($context->isFirstPass());
     $this->assertFalse($context->needsCompleteGeneration());
     $context->setToSecondPass();
     $this->assertFalse($context->isFirstPass());
     $this->assertFalse($context->needsCompleteGeneration());
     $context->markAsNeedsCompleteGeneration();
     $this->assertFalse($context->isFirstPass());
     $this->assertTrue($context->needsCompleteGeneration());
     $context->unmarkAsNeedsCompleteGeneration();
     $this->assertFalse($context->isFirstPass());
     $this->assertFalse($context->needsCompleteGeneration());
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function generate(FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, GenerationContext $context) : ObjectBag
 {
     if ($context->isFirstPass()) {
         $fixtureSet = $this->instantiator->instantiate($fixture, $fixtureSet, $context)->getObjects();
         if (false === $context->needsCompleteGeneration()) {
             return $fixtureSet;
         }
     }
     $fixtureSet = $this->completeObject($fixture, $fixtureSet, $context);
     return $fixtureSet->getObjects();
 }
Exemplo n.º 3
0
 private function isObjectComplete(FixtureInterface $fixture, ObjectInterface $object, GenerationContext $context) : bool
 {
     return $object instanceof CompleteObject || $context->needsCompleteGeneration() || false === $context->isFirstPass() || false === $context->needsCompleteGeneration() && $fixture->getSpecs()->getProperties()->isEmpty() && $fixture->getSpecs()->getMethodCalls()->isEmpty();
 }