Moodle
  1. Moodle
  2. MDL-40110

Behat test failing because of AM hardcoded being "AM" and "PM" OS-dependant strings

    Details

      Description

      The AM/PM string is OS-dependant, on Mac OSX it is lowercased.

        Gliffy Diagrams

          Activity

          Hide
          David Monllaó added a comment -

          Adding pull branches removing the AM/PM from the test as in not specially important and the workaround to include the AM/PM checking is tricky.

          The same patch can be applied to 2.5 and master

          Show
          David Monllaó added a comment - Adding pull branches removing the AM/PM from the test as in not specially important and the workaround to include the AM/PM checking is tricky. The same patch can be applied to 2.5 and master
          Hide
          Frédéric Massart added a comment -

          Hi David, if you confirm that you cannot control whether the date will displayed with 'AM/PM' or in 24h format, then push for integration. Otherwise, you could change the time to a PM one. Cheers! Fred

          Show
          Frédéric Massart added a comment - Hi David, if you confirm that you cannot control whether the date will displayed with 'AM/PM' or in 24h format, then push for integration. Otherwise, you could change the time to a PM one. Cheers! Fred
          Hide
          Dan Poltawski added a comment - - edited

          From: http://php.net/manual/en/function.strftime.php
          Mac OS X only: The %P modifier is not supported in the Mac OS X implementation of this function.

          userdate by default uses:

          $string['strftimedaydatetime'] = '%A, %d %B %Y, %I:%M %p';
          

          Show
          Dan Poltawski added a comment - - edited From: http://php.net/manual/en/function.strftime.php Mac OS X only: The %P modifier is not supported in the Mac OS X implementation of this function. userdate by default uses: $string['strftimedaydatetime'] = '%A, %d %B %Y, %I:%M %p';
          Hide
          David Monllaó added a comment -

          Thanks Fred and Dan

          Show
          David Monllaó added a comment - Thanks Fred and Dan
          Hide
          Dan Poltawski added a comment -

          Hi David,

          FYI - the same branch can't be pulled into both master and 25 (try for yourself doing a git pull) so please create separate branches (preffered) or ask an integrator to cherry-pick. Else I try and pull it and create a mess . In the future we hope to do automatic checks based on branches, so thats why its prefferable to have branches.

          Show
          Dan Poltawski added a comment - Hi David, FYI - the same branch can't be pulled into both master and 25 (try for yourself doing a git pull) so please create separate branches (preffered) or ask an integrator to cherry-pick. Else I try and pull it and create a mess . In the future we hope to do automatic checks based on branches, so thats why its prefferable to have branches.
          Hide
          Dan Poltawski added a comment -

          Integrated to master and 25, thanks David

          Show
          Dan Poltawski added a comment - Integrated to master and 25, thanks David
          Hide
          Dan Poltawski added a comment -

          Tested on my mac, was broken before, thsi fixes the issue

          Show
          Dan Poltawski added a comment - Tested on my mac, was broken before, thsi fixes the issue
          Hide
          David Monllaó added a comment -

          Thanks for the info Dan, I didn't notice as I usually fetch & cherry-pick, sorry about that

          Show
          David Monllaó added a comment - Thanks for the info Dan, I didn't notice as I usually fetch & cherry-pick, sorry about that
          Hide
          Dan Poltawski added a comment -

          Thanks for your contributions!

          _main:
          @ BB#0:
                  push    {r7, lr}
                  mov     r7, sp
                  sub     sp, #4
                  movw    r0, :lower16:(L_.str-(LPC0_0+4))
                  movt    r0, :upper16:(L_.str-(LPC0_0+4))
          LPC0_0:
                  add     r0, pc
                  bl      _printf
                  movs    r1, #0
                  movt    r1, #0
                  str     r0, [sp]                @ 4-byte Spill
                  mov     r0, r1
                  add     sp, #4
                  pop     {r7, pc}
           
                  .section        __TEXT,__cstring,cstring_literals
          L_.str:                                 @ @.str
                  .asciz   "This code is now upstream!"
          

          Show
          Dan Poltawski added a comment - Thanks for your contributions! _main: @ BB#0: push {r7, lr} mov r7, sp sub sp, #4 movw r0, :lower16:(L_.str-(LPC0_0+4)) movt r0, :upper16:(L_.str-(LPC0_0+4)) LPC0_0: add r0, pc bl _printf movs r1, #0 movt r1, #0 str r0, [sp] @ 4-byte Spill mov r0, r1 add sp, #4 pop {r7, pc}   .section __TEXT,__cstring,cstring_literals L_.str: @ @.str .asciz "This code is now upstream!"

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: