function create_new_user() { global $connection; if (!query_insert_user()) { return 0; } elseif (!query_insert_address()) { return 0; } else { return 1; } }
function query_insert_user_test_success() { //good connection global $connection; session_unset(); $_SESSION['firstname'] = "testname"; $_SESSION['lastname'] = "testname"; $_SESSION['email'] = "testemail"; $_SESSION['role'] = 1; $_SESSION['password'] = '******'; $_POST['address'] = "address"; $_POST['city'] = "city"; $_POST['county'] = "county"; $_POST['postcode'] = "postcode"; $_POST['country'] = "country"; $_POST['phonenumber'] = "notanumber"; assert(query_insert_user()); }