예제 #1
0
파일: Route.php 프로젝트: rmhdev/cercanias
 /**
  * @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;
 }
예제 #2
0
 /**
  * @dataProvider getIdProvider
  */
 public function testGetId($id)
 {
     $station = new Station($id, "Irún", "61");
     $this->assertEquals($id, $station->getId());
 }