public function testReadAccessorsReturnPropertiesValues()
{
$fixtureId = 'user0';
$fixture = new DummyFixture($fixtureId);
$templateId = 'user_base';
$template = new TemplatingFixture(new SimpleFixtureWithFlags(new DummyFixture($templateId), (new FlagBag('user_base'))->withFlag(new TemplateFlag())));
$bag = (new TemplatingFixtureBag())->with($fixture)->with($template);
$this->assertTrue($bag->has($fixtureId));
$this->assertFalse($bag->hasTemplate($fixtureId));
$this->assertEquals($fixture, $bag->get($fixtureId));
$this->assertTrue($bag->has($templateId));
$this->assertTrue($bag->hasTemplate($templateId));
$this->assertEquals($template, $bag->get($templateId));
$this->assertFalse($bag->has('foo'));
try {
$bag->get('foo');
$this->fail('Expected exception to be thrown.');
} catch (FixtureNotFoundException $exception) {
$this->assertEquals('Could not find the fixture "foo".', $exception->getMessage());
}
try {
$bag->getTemplate($fixtureId);
$this->fail('Expected exception to be thrown.');
} catch (FixtureNotFoundException $exception) {
// expected result
}
$this->assertEquals((new FixtureBag())->with($fixture), $bag->getFixtures());
}