I want to test my thrown exception, but test the exception class only, and not have to test the exception message. I saw this thread which was helpful, but didn't specifically address this: PHPUnit assert that an exception was thrown?
This assertion: $this->expectException(NotFoundException::class);
Leads to an error: Failed asserting that exception message is empty but is 'EXCEPTION MESSAGE'.
Is there a way for me to test ONLY the exception class, and NOT test the exception message? Or do I have to instead test the exception code ($this->expectExceptionCode(404
)?
(I am on PHPUnit 5.7)
Thanks!