public function addPlace($place)
{
if (!preg_match('{^[\\w\\d_-]+$}', $place)) {
throw new InvalidArgumentException(sprintf('The place "%s" contains invalid characters.', $place));
}
if (!$this->places) {
$this->initialPlace = $place;
}
$this->places[$place] = $place;
}
public function testAddPlace() { $builder = new DefinitionBuilder(array('a'), array()); $builder->addPlace('b'); $definition = $builder->build(); $this->assertCount(2, $definition->getPlaces()); $this->assertEquals('a', $definition->getPlaces()['a']); $this->assertEquals('b', $definition->getPlaces()['b']); }