do not test if the name exists, test if the name you gave on insertCountry() equals the value that $country->name holds.