public canInstantiate ( Nelmio\Alice\FixtureInterface $fixture ) : boolean | ||
$fixture | Nelmio\Alice\FixtureInterface | |
return | boolean |
public function canInstantiate(FixtureInterface $fixture) : bool
{
$constructor = $fixture->getSpecs()->getConstructor();
return null !== $constructor && false === $constructor instanceof NoMethodCall && null === $constructor->getCaller();
}
public function testCanInstantiateFixtureWithIfConstructorIsAMalformedFactory() { $fixture = new SimpleFixture('dummy', 'Dummy', SpecificationBagFactory::create(new SimpleMethodCall('fake'))); $this->assertTrue($this->instantiator->canInstantiate($fixture)); }