Skip to content

Commit

Permalink
MDL-68563 filters: Fix unit test regressions
Browse files Browse the repository at this point in the history
Also incrementing the plugin versions to make sure the unit test
environment is reinitialised and the tests are reliable.

Minor correction of phpdocs @Package tags included.
  • Loading branch information
mudrd8mz authored and lameze committed May 13, 2020
1 parent 4044914 commit 87f9e88
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions admin/tool/monitor/tests/eventobservers_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ public function test_replace_placeholders() {

$modurl = new moodle_url('/mod/book/view.php', array('id' => $book->cmid));

$this->assertContains('<h2>'.$event->get_url()->out().'</h2>', $msg->fullmessagehtml);
$this->assertContains('<li>'.$modurl->out().'</li>', $msg->fullmessagehtml);
$this->assertRegExp('~<h2>.*' . preg_quote($event->get_url()->out(), '~') . '.*</h2>~', $msg->fullmessagehtml);
$this->assertRegExp('~<li>.*' . preg_quote($modurl->out(), '~') . '.*</li>~', $msg->fullmessagehtml);
$this->assertContains('<li><strong>'.$rule->get_name($context).'</strong></li>', $msg->fullmessagehtml);
$this->assertContains('<li>'.$rule->get_description($context).'</li>', $msg->fullmessagehtml);
$this->assertContains('<li>'.$rule->get_event_name().'</li>', $msg->fullmessagehtml);
Expand Down
6 changes: 3 additions & 3 deletions course/tests/externallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2383,8 +2383,8 @@ public function test_get_courses_by_field() {
$this->assertCount(2, $result['courses']);

// Check default filters.
$this->assertCount(4, $result['courses'][0]['filters']);
$this->assertCount(4, $result['courses'][1]['filters']);
$this->assertCount(6, $result['courses'][0]['filters']);
$this->assertCount(6, $result['courses'][1]['filters']);

$result = core_course_external::get_courses_by_field('category', $category1->id);
$result = external_api::clean_returnvalue(core_course_external::get_courses_by_field_returns(), $result);
Expand Down Expand Up @@ -2426,7 +2426,7 @@ public function test_get_courses_by_field() {

// Check default filters.
$filters = $result['courses'][0]['filters'];
$this->assertCount(4, $filters);
$this->assertCount(6, $filters);
$found = false;
foreach ($filters as $filter) {
if ($filter['filter'] == 'mediaplugin' and $filter['localstate'] == TEXTFILTER_OFF) {
Expand Down
5 changes: 2 additions & 3 deletions filter/emoticon/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
/**
* Version information
*
* @package filter
* @subpackage emoticon
* @package filter_emoticon
* @copyright 2010 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2019111800; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2020051200; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2019111200; // Requires this Moodle version
$plugin->component = 'filter_emoticon'; // Full name of the plugin (used for diagnostics)
3 changes: 1 addition & 2 deletions filter/urltolink/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
/**
* Version details
*
* @package filter
* @subpackage urltolink
* @package filter_urltolink
* @copyright 2010 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/editor/atto/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2019111800; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2020051200; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2019111200; // Requires this Moodle version.
$plugin->component = 'editor_atto'; // Full name of the plugin (used for diagnostics).
4 changes: 2 additions & 2 deletions lib/tests/weblib_format_text_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ public function test_format_text_format_moodle_no_filters() {
}

public function test_format_text_overflowdiv() {
$this->assertEquals('<div class="no-overflow"><p>:-)</p></div>',
format_text('<p>:-)</p>', FORMAT_HTML, array('overflowdiv' => true)));
$this->assertEquals('<div class="no-overflow"><p>Hello world</p></div>',
format_text('<p>Hello world</p>', FORMAT_HTML, array('overflowdiv' => true)));
}

/**
Expand Down

0 comments on commit 87f9e88

Please sign in to comment.