Commit 216b8947 authored by Mihail Geshoski's avatar Mihail Geshoski
Browse files

MDL-54741 general: 3.2 final deprecation in lib/deprecatedlib.php

parent 6e020b16
......@@ -6,6 +6,8 @@ information provided here is intended especially for developers.
* calendar_set_filters() function now has optional $user parameter.
* The core_calendar\local\event\container class now provides two new helper methods for getting and setting the requesting user:
set_requesting_user() and get_requesting_user().
* The following functions have been finally deprecated and can not be used anymore:
* calendar_preferences_button()
=== 3.5 ===
* core_calendar_external::get_calendar_events now returns the categoryid for category events.
......
This diff is collapsed.
......@@ -39,165 +39,21 @@ require_once($CFG->libdir . '/csslib.php');
*/
class core_csslib_testcase extends advanced_testcase {
public function test_background() {
$optimiser = new css_optimiser();
$cssin = '.test {background-color: #123456;}';
$this->assertSame($cssin, $optimiser->process($cssin));
$this->assertDebuggingCalled('class css_optimiser is deprecated and no longer does anything, '
. 'please consider using stylelint to optimise your css.');
}
/**
* Test CSS colour matching.
* Test that css_is_colour function throws an exception.
*/
public function test_css_is_colour() {
$debugstr = 'css_is_colour() is deprecated without a replacement. Please copy the implementation '
. 'into your plugin if you need this functionality.';
// First lets test hex colours.
$this->assertTrue(css_is_colour('#123456'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('#123'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('#ABCDEF'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('#ABC'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('#abcdef'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('#abc'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('#aBcDeF'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('#aBc'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('#1a2Bc3'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('#1Ac'));
$this->assertDebuggingCalled($debugstr);
// Note the following two colour's aren't really colours but browsers process
// them still.
$this->assertTrue(css_is_colour('#A'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('#12'));
$this->assertDebuggingCalled($debugstr);
// Having four or five characters however are not valid colours and
// browsers don't parse them. They need to fail so that broken CSS
// stays broken after optimisation.
$this->assertFalse(css_is_colour('#1234'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('#12345'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('#BCDEFG'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('#'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('#0000000'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('#132-245'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('#13 23 43'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('123456'));
$this->assertDebuggingCalled($debugstr);
// Next lets test real browser mapped colours.
$this->assertTrue(css_is_colour('black'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('blue'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('BLACK'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('Black'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('bLACK'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('mediumaquamarine'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('mediumAquamarine'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('monkey'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour(''));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('not a colour'));
$this->assertDebuggingCalled($debugstr);
// Next lets test rgb(a) colours.
$this->assertTrue(css_is_colour('rgb(255,255,255)'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('rgb(0, 0, 0)'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('RGB (255, 255 , 255)'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('rgba(0,0,0,0)'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('RGBA(255,255,255,1)'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('rgbA(255,255,255,0.5)'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('rgb(-255,-255,-255)'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_colour('rgb(256,-256,256)'));
$this->assertDebuggingCalled($debugstr);
// Now lets test HSL colours.
$this->assertTrue(css_is_colour('hsl(0,0%,100%)'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('hsl(180, 0%, 10%)'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_colour('hsl (360, 100% , 95%)'));
$this->assertDebuggingCalled($debugstr);
// Finally test the special values.
$this->assertTrue(css_is_colour('inherit'));
$this->assertDebuggingCalled($debugstr);
$this->expectException('coding_exception');
$this->expectExceptionMessage('css_is_colour() can not be used anymore.');
css_is_colour();
}
/**
* Test the css_is_width function.
* Test that css_is_width function throws an exception.
*/
public function test_css_is_width() {
$debugstr = 'css_is_width() is deprecated without a replacement. Please copy the implementation '
. 'into your plugin if you need this functionality.';
$this->assertTrue(css_is_width('0'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_width('0px'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_width('0em'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_width('199px'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_width('199em'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_width('199%'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_width('-1px'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_width('auto'));
$this->assertDebuggingCalled($debugstr);
$this->assertTrue(css_is_width('inherit'));
$this->assertDebuggingCalled($debugstr);
// Valid widths but missing their unit specifier.
$this->assertFalse(css_is_width('0.75'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_width('3'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_width('-1'));
$this->assertDebuggingCalled($debugstr);
// Totally invalid widths.
$this->assertFalse(css_is_width('-'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_width('bananas'));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_width(''));
$this->assertDebuggingCalled($debugstr);
$this->assertFalse(css_is_width('top'));
$this->assertDebuggingCalled($debugstr);
$this->expectException('coding_exception');
$this->expectExceptionMessage('css_is_width() can not be used anymore.');
css_is_width();
}
}
......@@ -25,6 +25,18 @@ information provided here is intended especially for developers.
- site_scale_used()
- clam_message_admins()
- get_clam_error_code()
- get_records_csv()
- put_records_csv()
- print_log()
- print_mnet_log()
- print_log_csv()
- print_log_xls()
- print_log_ods()
- build_logs_array()
- get_logs_usercourse()
- get_logs_userday()
- get_logs()
- prevent_form_autofill_password()
* The following classes have been finally deprecated and can not be used any more:
- core_media_renderer
- core_media
......
This files describes API changes in /message/ messaging system,
information provided here is intended especially for developers.
=== 3.6 ===
* The following functions have been finally deprecated and can not be used anymore:
* message_get_course_contexts()
* message_remove_url_params()
* message_count_messages()
* message_count_blocked_users()
* message_contact_link()
* message_history_link()
* message_shorten_message()
* message_get_fragment()
* message_get_contact_add_remove_link()
* message_get_contact_block_link()
* message_mark_messages_read()
* message_page_type_list()
* message_can_post_message()
* message_is_user_non_contact_blocked()
* message_is_user_blocked()
=== 3.5 ===
* Changed the database structure so there are no longer two tables for messages, with the only
......
......@@ -8,6 +8,8 @@ information provided here is intended especially for developers.
* lti_get_shortcuts has been deprecated. Please use get_shortcuts() instead to add items to the activity chooser.
* Now, when mod_<modname>_core_calendar_is_event_visible or mod_<modname>_core_calendar_provide_event_action callback functions
are called, the userid of the requesting user is also passed to them.
* The following functions have been finally deprecated and can not be used anymore:
- update_module_button()
=== 3.5 ===
......
......@@ -13,6 +13,11 @@ information provided here is intended especially for theme designer.
- Microsoft Edge: The body class should change from safari to edge.
- Mobile safari: The class ios should exist, safari class should be removed.
* Remove class .safari styling from activity chooser dialog for theme boost and bootstrapbase.
* The following functions and classes have been finally deprecated and can not be used anymore:
* css_is_colour()
* css_is_width()
* css_sort_by_count()
* class css_optimiser
=== 3.4 ===
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment