If a graph fails the vertical line test it's not a function; you can't have a single x map to two ys.
Vice versa, if the graph passes the verticle line test, it's a function.
The horizontal line test tests for injectivity aka one-to-one-ness; it has no bearing on whether something's a function.