Skip to content

Don't deprecate setExpectedException(), this will cause issues. #2074

@schlessera

Description

@schlessera

I just read the article https://thephp.cc/news/2016/02/questioning-phpunit-best-practices, and cannot really comprehend the conclusion.

I applaud the move to a better structure to test exceptions. And I have always used the setExpectedException() instead of the annotation, because of some of the reasons you have mentioned.

However, in the article, the conclusion is that setExpectedException() will be deprecated for PHPUnit 6, and the annotation will stay.

This means that I cannot use the new functions because of the PHP version requirements, and can't continue to use setExpectedException() because it will become deprecated... so you basically force me to instead use the annotation now for the foreseeable future.

I think that there's no harm in keeping the setExpectedException() method for now, and it can be rewritten as a simple stub that uses the new methods for better maintainability. So please don't deprecate it (just yet).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions