Nelmio\Alice\Definition\Fixture\TemplatingFixture::withSpecs PHP Method

withSpecs() public method

public withSpecs ( SpecificationBag $specs ) : self
$specs Nelmio\Alice\Definition\SpecificationBag
return self
    public function withSpecs(SpecificationBag $specs) : self
    {
        $clone = clone $this;
        $clone->fixture = $this->fixture->withSpecs($specs);
        return $clone;
    }

Usage Example

Example #1
0
 public function getExtendedFixture(TemplatingFixture $fixture, FixtureBag $extendedFixtures)
 {
     $specs = $fixture->getSpecs();
     foreach ($extendedFixtures as $extendedFixture) {
         /** @var FixtureInterface $extendedFixture */
         $specs = $specs->mergeWith($extendedFixture->getSpecs());
     }
     return $fixture->withSpecs($specs);
 }