test($compile): add test for optional `require` in directives with `^` operator

The directive property `require` allows optional requirement via
the `?` before or after the `^` operator. Add tests to ensure this
functionality is not lost inadvertently.

Closes #9391
@caitp, I'm planning on adding `|| null` to [this line](https://github.com/angular/angular.js/blob/391d8c04da85347128bfd0a7d19f384d71f294e4/src/ng/compile.js#L1760) which fixes this bug.

```javascript
                                                                      //  all tests pass when I add this ↓
value = value || $searchElement[retrievalMethod]('$' + require + 'Controller') || null;
```

Preparing a PR now. Let me know if you think that there's a better solution.