I'd wrap these `@`-silenced calls to be more explicit in what you're testing:

```php
set_error_handler(function ($errno, $errstr) { return true; }, E_NOTICE|E_WARNING);
try {
    $this->renderer->render('is-directory');
    $caught = false;
} catch (\Exception $e) {
    $caught = $e;
}
restore_error_handler();
$this->assertInstanceOf('Zend\View\Exception\UnexpectedValueException', $caught);
$this->assertContains('file include failed', $caught->getMessage());
```

You can then also remove the `setExpectedException()` calls, obviously. The above approach ensures that the notice and/or warnings are ignored by PHPUnit, and then allows us to test for the exception.