public function testAddPlaces() { $places = range('a', 'e'); $definition = new Definition($places); $this->assertCount(5, $definition->getPlaces()); $this->assertEquals('a', $definition->getInitialPlace()); }
private function findPlaces(Definition $definition, Marking $marking = null) { $places = array(); foreach ($definition->getPlaces() as $place) { $attributes = array(); if ($place === $definition->getInitialPlace()) { $attributes['style'] = 'filled'; } if ($marking && $marking->has($place)) { $attributes['color'] = '#FF0000'; $attributes['shape'] = 'doublecircle'; } $places[$place] = array('attributes' => $attributes); } return $places; }