diff --git a/filter/emoticon/tests/filter_test.php b/filter/emoticon/tests/filter_test.php index 45c2d58c703..fab2e365238 100644 --- a/filter/emoticon/tests/filter_test.php +++ b/filter/emoticon/tests/filter_test.php @@ -54,8 +54,7 @@ class filter_emoticon_testcase extends advanced_testcase { $this->assertEquals($expected, $filter->filter('(grr)', $options)); // And texts matching target formats are filtered. - $expected = 'angry'; + $expected = ''; $options = array('originalformat' => FORMAT_HTML); // Only FORMAT_HTML is filtered, see {@link testable_filter_emoticon}. $this->assertEquals($expected, $filter->filter('(grr)', $options)); } diff --git a/lib/tests/filter_manager_test.php b/lib/tests/filter_manager_test.php index 85b7632e4d3..816bd95a215 100644 --- a/lib/tests/filter_manager_test.php +++ b/lib/tests/filter_manager_test.php @@ -54,7 +54,8 @@ class core_filter_manager_testcase extends advanced_testcase { public function test_filter_normal() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); - $this->assertRegExp('~^

smile]+)>

$~', + $this->assertRegExp('~^

' . + '

$~', $this->filter_text('

:-)

', array())); } @@ -68,7 +69,8 @@ class core_filter_manager_testcase extends advanced_testcase { public function test_disabling_other_filter_does_not_break_it() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); - $this->assertRegExp('~^

smile]+)>

$~', + $this->assertRegExp('~^

' . + '

$~', $this->filter_text('

:-)

', array('urltolink'))); } @@ -76,7 +78,8 @@ class core_filter_manager_testcase extends advanced_testcase { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); filter_set_global_state('urltolink', TEXTFILTER_ON); - $this->assertRegExp('~^

smile]+)> http://google.com/

$~', + $this->assertRegExp('~^

' . + ' http://google.com/

$~', $this->filter_text('

:-) http://google.com/

', array('glossary', 'urltolink'))); } } diff --git a/lib/tests/weblib_format_text_test.php b/lib/tests/weblib_format_text_test.php index d0be09fc939..dfaf83efd74 100644 --- a/lib/tests/weblib_format_text_test.php +++ b/lib/tests/weblib_format_text_test.php @@ -37,7 +37,8 @@ class core_weblib_format_text_testcase extends advanced_testcase { public function test_format_text_format_html() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); - $this->assertRegExp('~^

smile]+)>

$~', + $this->assertRegExp('~^

' . + '

$~', format_text('

:-)

', FORMAT_HTML)); } @@ -66,7 +67,8 @@ class core_weblib_format_text_testcase extends advanced_testcase { public function test_format_text_format_markdown() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); - $this->assertRegExp('~^

smile]+)>

\n$~', + $this->assertRegExp('~^

' . + '

\n$~', format_text('*:-)*', FORMAT_MARKDOWN)); } @@ -80,7 +82,9 @@ class core_weblib_format_text_testcase extends advanced_testcase { public function test_format_text_format_moodle() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); - $this->assertRegExp('~^

smile]+)>

$~', + $this->assertRegExp('~^

' . + '' . + '

$~', format_text('

:-)

', FORMAT_MOODLE)); } diff --git a/mod/resource/tests/lib_test.php b/mod/resource/tests/lib_test.php index 0c507adffff..39950c1550c 100644 --- a/mod/resource/tests/lib_test.php +++ b/mod/resource/tests/lib_test.php @@ -143,12 +143,12 @@ class mod_resource_lib_testcase extends advanced_testcase { $info = resource_get_coursemodule_info( $DB->get_record('course_modules', array('id' => $resource2->cmid))); $this->assertEquals('R2', $info->name); - $this->assertEquals('f/text-24', $info->icon); + $this->assertEquals('f/text', $info->icon); // For third one, it should use the highest sortorder icon. $info = resource_get_coursemodule_info( $DB->get_record('course_modules', array('id' => $resource3->cmid))); $this->assertEquals('R3', $info->name); - $this->assertEquals('f/document-24', $info->icon); + $this->assertEquals('f/document', $info->icon); } }