示例#1
0
        function testBookings() 
        {
			
			//
			// load()
			//
			$BookingsAPI = new Bookings("ws.bookings.nl", "/xml-rpc", "username", "password");

			
			// Get countries
			$cc = $BookingsAPI->GetCountryList();
			$this->assertTrue(count($cc) > 0, "Get countries list");	
			
			// Get cities
			$cities = $BookingsAPI->GetCityList($cc[0]["code"]);
			$this->assertTrue(count($cities) > 0, "Get cities list");
			
			// get Hotel list
			$hotels = $BookingsAPI->GetHotelList($cities[0]["city_id"]);
			$this->assertTrue(count($hotels) > 0, "Get hotels list");
			
			// get Hotel details
			$hotel_details = $BookingsAPI->GetHotelDetails($hotels[0]["id"]);
			$this->assertTrue((is_array($hotel_details) && $hotel_details["lang"]["maxrate"]), "Get hotel details");
			
			// Get rooms list
			$rooms = $BookingsAPI->GetRoomsList($hotels[0]["id"]);
			$this->assertTrue(count($rooms) > 0, "Get rooms list");
			
			// get Room type
			$type = $BookingsAPI->GetRoomType($rooms[0]["roomtype_id"]);
			$this->assertTrue(count($type) > 0, "Get roomtype name");
			
			$id = $BookingsAPI->GetHotelID($hotels[0]["name"], $cities[0]["city_id"]);
			$this->assertTrue($id, "Get Hotel id by name");
			
			$id = $BookingsAPI->GetCityID($cities[0]["name"], $cc[0]["code"]);
			$this->assertTrue($id, "Get City id by name");
			
			$id = $BookingsAPI->GetCountryCode($cc[0]["name"]);
			$this->assertTrue($id, "Get Country code by name");
			
			$fac = $BookingsAPI->GetHotelFacilities($hotels[2]["id"]);
			$this->assertTrue(count($fac) > 0, "Get Hotel Facilities");
			
			// get Room info
        }