Pregnant???

I had unprotected sex last week and didn't think much of it until like five days later and then took the emergency contraceptive pill, but it was a bit late to take it and now I'm freaking out because of where I was in my cycle... 
He didn't cum inside me but at one point he pulled out and was like did you cum? And I'm like no.. And he's like oh.. So I'm kinda freaking out. 
When is the earliest I can test for it?