/** * @param Station $station * @throws \Cercanias\Exception\DuplicateKeyException */ public function addStation(Station $station) { if ($this->hasStation($station->getId())) { throw new DuplicateKeyException("Station id already exists"); } $this->stations[$station->getId()] = $station; }
/** * @dataProvider getIdProvider */ public function testGetId($id) { $station = new Station($id, "Irún", "61"); $this->assertEquals($id, $station->getId()); }