Advertisement
Noah-Huppert

UserEmail Test V2

Nov 3rd, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. /**
  2.  * Testing the relationships between Users and UserEmails
  3.  */
  4. public class UserEmailTest {
  5.     /**
  6.      * Tests creating a new User and then adding a UserEmail
  7.      * @param args Not used
  8.      */
  9.     public static main(String[] args){
  10.         User user = new User("userId", null);
  11.  
  12.         user.emails.add(new UserEmail("foo@bazz.com"));
  13.  
  14.         user.emails.get(0).save();
  15.         user.save();
  16.  
  17.         /* Result
  18.             When I look at the database(In phpMyAdmin) I can see that a new user has been created with the Id of "userId"
  19.             However when I look in the user_email table there are no emails
  20.          */
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement