function test_generateLocation() { $place_name = "Bombay Chaat House"; $address = "804 SW Yamhill St"; $latitude = 43.51983; $longitude = -122.68437; $id = 1; $test_place = new Place($place_name, $address, $latitude, $longitude, $id); $test_place->save(); $place_name2 = "Nordstrom Downtown Portland"; $address2 = "701 SW Broadway"; $latitude2 = 45.519229; $longitude2 = -122.680314; $id2 = 2; $test_place2 = new Place($place_name2, $address2, $latitude2, $longitude2, $id2); $test_place2->save(); $place_name3 = "Banana Republic"; $address3 = "710 SW Yamhill St"; $latitude3 = 45.518594; $longitude3 = -122.680357; $id3 = 3; $test_place3 = new Place($place_name3, $address3, $latitude3, $longitude3, $id3); $test_place3->save(); $result = Place::generateLocation(); $this->assertEquals(true, is_object($result)); }
static function setMeetupLocation($user1, $user2) { $temp_location = Place::generateLocation(); if ($temp_location->verifyLocation($user1, $user2)) { return $temp_location; } else { Place::setMeetupLocation($user1, $user2); } }