function it_throws_invalid_argument_exceptions() { $e = new DisallowedNonObjectTypehintException(); $this->addInvalid('Foo', 'boz', '$bar', $e); $this->shouldThrow($e)->duringLookup('Foo', 'boz', '$bar'); }