mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-44613 behat: strftime format in time to timestamp transformation
Modifies the 'string time to timestamp' behat trasformation to use userdate() instead of date(). The userdate() method is generally used throught Moodle for constructing formatted date strings and this change will provide more consistency and prevent any potential behat failures. Therefore, if the date format is defined in the given trasformation, it has to be strftime compatible. Example: 'I should see "##tomorrow noon##%A, %d %B %Y, %I:%M %p##"'
This commit is contained in:
parent
8ee6f49384
commit
9f01cf6122
2 changed files with 7 additions and 2 deletions
|
@ -167,8 +167,8 @@ class behat_transformations extends behat_base {
|
|||
|
||||
$count = count($timepassed);
|
||||
if ($count === 2) {
|
||||
// If timestamp with spcified format, then retrun date.
|
||||
return date($timepassed[1], $timestamp);
|
||||
// If timestamp with specified strftime format, then return formatted date string.
|
||||
return userdate($timestamp, $timepassed[1]);
|
||||
} else if ($count === 1) {
|
||||
return $timestamp;
|
||||
} else {
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
This files describes API changes in core libraries and APIs,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
=== 3.9.6 ===
|
||||
* The behat transformation 'string time to timestamp' no longer supports datetime format. If provided, the format must
|
||||
be strftime compatible. Example:
|
||||
- I should see "##tomorrow noon##%A, %d %B %Y, %I:%M %p##"
|
||||
|
||||
=== 3.9.4 ===
|
||||
* New optional parameter $extracontent for print_collapsible_region_start(). This allows developers to add interactive HTML elements
|
||||
(e.g. a help icon) after the collapsible region's toggle link.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue