public static createForFlagBagKeyMismatch ( Nelmio\Alice\FixtureInterface $fixture, |
||
$fixture | Nelmio\Alice\FixtureInterface | |
$flags | ||
return | InvalidArgumentException |
public function testTestCreateForFlagBagKeyMismatch() { $exception = InvalidArgumentExceptionFactory::createForFlagBagKeyMismatch(new DummyFixture('foo'), new FlagBag('bar')); $this->assertEquals('Expected the fixture ID and the flags key to be the same. Got "foo" and "bar" instead.', $exception->getMessage()); $this->assertEquals(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); }
public function __construct(FixtureInterface $fixture, FlagBag $flags) { if ($fixture->getId() !== $flags->getKey()) { throw InvalidArgumentExceptionFactory::createForFlagBagKeyMismatch($fixture, $flags); } $this->fixture = clone $fixture; $this->flags = $flags; }