I suspect PHPUnit is showing that 1 line of code is not covered by unit tests because of exceptions thats thrown (but I caught)

 [![](https://imgur.com/Q8Fry.jpg)](https://imgur.com/Q8Fry.jpg) 

I have unit test that should cover that line

```
/**
 * @expectedException Doctrine\ORM\NoResultException
 */
public function testCannotLoginInvalidUser() {

  $user = User::login($this->em, 'nonExistant', 'password');
  $this->assertNull($user);

}

```

Why is my code coverage still reflecting that is not covered? 

I did a test ... added echo b4 returning null ... I found that that line is really not covered ... 

```
try {
  $user = $query->getSingleResult();
} catch (Exception $e) {
  echo 'caught exception';  <-- this does not get executed. 
  return null;
}

```

Is PHPUnit skipping all execution once an exception is thrown?

***UPDATE***: I got a feeling that I am using `@expectedException` wrong tho ...