Exemple #1
0
 /**
  * @expectedException Travel_BadPriceException
  */
 public function testExtendBadPrice()
 {
     $from = 'A';
     $to = 'C';
     $priceList = array(array('from' => 'A', 'to' => 'B', 'price' => 3), array('from' => 'A', 'to' => 'D', 'price' => 3), array('from' => 'A', 'to' => 'F', 'price' => 6), array('from' => 'B', 'to' => 'D', 'price' => 80), array('from' => 'B', 'to' => 'E', 'price' => 80), array('from' => 'C', 'to' => 'H', 'price' => 80));
     $routeSearch = new Travel_Route($priceList);
     $routeSearch->addRoute('B', 'C', 'даром');
     $result = $routeSearch->search($from, $to);
     $this->assertEquals(83, $result['price']);
 }