MDL-83412 core: Coding style fixes

This commit is contained in:
Jun Pataleta 2024-11-28 11:54:31 +08:00
parent 68c96a97b9
commit e7556aa106
No known key found for this signature in database
GPG Key ID: F83510526D99E2C7
4 changed files with 17 additions and 5 deletions

View File

@ -304,7 +304,7 @@ class structure extends type_base {
// The documentation for strftime notes that for the "%l" and "%e" specifiers where
// no leading zero is used, a space is used instead.
// As a result we switch to the new format specifiers "%l" and "%e", wrap them in placeholders
// and then remove the spaces
// and then remove the spaces.
if (empty($CFG->nofixday) && $fixday) {
// Config.php can force %d not to be fixed, but only if the format did not specify it.

View File

@ -36,7 +36,7 @@ final class structure_test extends \advanced_testcase {
* Test the timestamp_to_date_string method with different input values.
*
* @dataProvider timestamp_to_date_string_provider
* @param string $lang
* @param string $locale
* @param int $timestamp
* @param string $format
* @param string $timezone

View File

@ -17,14 +17,13 @@
namespace core\tests;
/**
* A string manager which supports mocking individaul strings.
* A string manager which supports mocking individual strings.
*
* @package core
* @copyright Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class mocking_string_manager extends \core_string_manager_standard {
class mocking_string_manager extends \core_string_manager_standard {
/** @var array<string, string> The list of strings */
private $strings = [];
@ -37,6 +36,14 @@ namespace core\tests;
return parent::get_string($identifier, $component, $a, $lang);
}
/**
* Mock a string.
*
* @param string $identifier
* @param string $component
* @param string $value
* @return void
*/
public function mock_string(
string $identifier,
string $component,

View File

@ -697,6 +697,11 @@ class date_test extends advanced_testcase {
$this->assertEqualsIgnoringWhitespace($expected, core_date::strftime($format, $input));
}
/**
* Data provider for ::test_strftime_locale.
*
* @return array[]
*/
public static function get_strftime_locale_provider(): array {
return [
'Month Year only' => [