Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299325

Replace @expectedException @expectedExceptionMessage with $this->setExpectedException

$
0
0

Problem/Motivation

Using @expectedException is not considered good testing practice because you cannot specify where exactly in the test method the exception should be triggered. Background info: https://thephp.cc/news/2016/02/questioning-phpunit-best-practices

Proposed resolution

We should use the method setExpectedException() instead right before the line that triggers the exception (usually right before the last line).

Remaining tasks

Review patch.


Viewing all articles
Browse latest Browse all 299325

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>