Integration round 2016-07-28: Expected exception

Integration round 2016-07-28: Expected exception

by David Monllaó -
Number of replies: 2

Cold numbers:

88 issues have been successfully integrated, 11 rejected and 3 delayed - 88.89% success.


Notes:

  • Charts JS has been selected as the new charts library for Moodle, most of Moodle's graphs have been converted to chartsjs already, more to come. You can take a look at them in master branch as MDL-54987 has already been integrated.
  • If you are a developer you have probably used setExpectedException method when writing unit tests, master branch switched to phpunit 5.4 branch, expectedException() and expectedExceptionMessage() should be used instead now. More info in MDL-55091
  • Ongoing discussions regarding Moodle hooks in MDL-44078 and https://moodle.org/mod/forum/discuss.php?d=327349
  • We updated jQuery to 3.1 in master branch, you may be interested in checking jQuery change log if you are using it in your plugins


Hot topics:

  • MDL-54987: Introduce a new chart API and library
  • MDL-55048: Upgrade grunt and npm dependencies (and add travis checks on node version variants)
  • MDL-31356: IMS Enterprise enrol plugin added features
  • MDL-37250: Lessons students attempts are not saved if they timeout
  • MDL-54977: Getting to the bottom level of menus breaks them
  • MDL-18599: Upon restore, association of "owner" of single simple discussion forum type defaults to user completing restore. Solution: hide author of the first post
  • MDL-50937: Update to JQuery 3.1
  • MDL-53222: Revise admin settings/report for global search for improved usability
  • MDL-11369: Choice deadline does not appear in the course calendar


Warm thanks:

To Ken Task, for his dedication helping to everybody in the forums, always positive. And because Yesterday it was his 10 years Moodle anniversary!

Average of ratings: -
In reply to David Monllaó

Re: Integration round 2016-07-28: Expected exception

by Dan Poltawski -

Hi David,

I believe your advice is about @expectedException is not the best practice.

See this article from the author of phpunit: https://thephp.cc/news/2016/02/questioning-phpunit-best-practices


A New Best Practice: expectException()

[...]

Back when the annotation was added to PHPUnit there was no support for namespaces in PHP. These days, though, namespaces are commonly used in PHP code. And since an annotation such as @expectedException is technically only a comment and not part of the code you have to use a fully-qualified class name such as vendor\project\Examplewhen you use it. In a comment you cannot use an unqualified class name, Example for instance, that you would be able to use in code when that class is in or imported into the current namespace.

[...]

PHPUnit will consider the test shown in the example above then and only then a success when the expected exception is raised after the call to the expectException() method

Average of ratings: Useful (1)
In reply to Dan Poltawski

Re: Integration round 2016-07-28: Expected exception

by David Monllaó -

Thanks Dan, I wasn't aware of it, I am changing the post above; even if the annotation way is not deprecated (actually I haven't found any more info about them not being recommendable) it is better to suggest people using expectException() function instead.