Skip to content

Commit

Permalink
Fixing tests due to PHPCompatibility 7.1.2 upgrade
Browse files Browse the repository at this point in the history
* Sniff for invoking throw has been removed, see
  PHPCompatibility/PHPCompatibility#118
* Some sniffs about old functions changed from warnings to errors.
* Wording of some warnings/errors changed.
  • Loading branch information
polothy committed Mar 31, 2017
1 parent 3070b0f commit 18d40b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
final($object);
instanceof($object);
private($object);
throw($object);
// throw($object); See https://github.com/wimg/PHPCompatibility/issues/118
trait($object);
11 changes: 6 additions & 5 deletions moodle/tests/moodlestandard_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function test_moodle_php_forbiddennamesasinvokedfunctions() {
22 => 'T_FINAL',
23 => 1,
24 => 1,
25 => 1,
25 => 0,
26 => 1));
$this->set_warnings(array());

Expand Down Expand Up @@ -279,9 +279,10 @@ public function test_phpcompatibility_php_deprecatedfunctions() {
// - line => number of problems, or
// - line => array of contents for message / source problem matching.
// - line => string of contents for message / source problem matching (only 1).
$this->set_errors(array());
$this->set_warnings(array(
5 => array('function ereg_replace', 'use call_user_func instead', '@Source: PHPCompat')));
$this->set_errors(array(
5 => array('Function ereg_replace', 'Use call_user_func instead', '@Source: PHPCompat')
));
$this->set_warnings(array());

// Let's do all the hard work!
$this->verify_cs_results();
Expand All @@ -302,7 +303,7 @@ public function test_phpcompatibility_php_forbiddencalltimepassbyreference() {
// - line => array of contents for message / source problem matching.
// - line => string of contents for message / source problem matching (only 1).
$this->set_errors(array(
6 => array('call-time pass-by-reference is prohibited'),
6 => array('call-time pass-by-reference is deprecated'),
7 => array('@Source: PHPCompat')));
$this->set_warnings(array());

Expand Down

0 comments on commit 18d40b6

Please sign in to comment.