Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-47647

Messagelib attachment unit test fails (on Windows?)

XMLWordPrintable

      1) core_messagelib_testcase::test_message_attachment_send

      Failed asserting that false is true.
       
      C:\Users\tjh238\workspace\moodle_head\lib\tests\messagelib_test.php:762
      C:\Users\tjh238\workspace\moodle_head\lib\phpunit\classes\advanced_testcase.php:80
       
      To re-run:
       vendor/phpunit/phpunit/composer/bin/phpunit core_messagelib_testcase lib\tests\messagelib_test.php
      

      The failing assert is

      $this->assertTrue(strpos($email->body, 'Content-Disposition: attachment;') !== false);
      

      The $email object looks like

      stdClass Object
      (
          [header] => Date: Mon, 13 Oct 2014 15:05:32 +0100
      From: "Admin User" <>
      Message-ID: <e620de14f000b6ab0f228d427c958e6e@PCD265396>
      X-Priority: 3
      X-Mailer: PHPMailer Moodle 2014101000 (https://github.com/PHPMailer/PHPMailer/)
      MIME-Version: 1.0
      Content-Type: multipart/alternative;
              boundary="b1_e620de14f000b6ab0f228d427c958e6e"
       
          [body] => --b1_e620de14f000b6ab0f228d427c958e6e
      Content-Type: text/plain; charset=UTF-8
      Content-Transfer-Encoding: quoted-printable
       
       
      message body
       
       
      --b1_e620de14f000b6ab0f228d427c958e6e
      Content-Type: text/html; charset=UTF-8
      Content-Transfer-Encoding: quoted-printable
       
      <p>message body</p>
       
       
      --b1_e620de14f000b6ab0f228d427c958e6e--
       
          [subject] => message subject 1
          [from] =>
          [to] => username1@example.com
      )
      

      There is, indeed, no "Content-Disposition: attachment;" text there.

      I am running the tests on Windows 7, with

      PHP 5.5.11 (cli) (built: Apr  2 2014 16:04:12)
      Copyright (c) 1997-2014 The PHP Group
      Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
      

            abgreeve Adrian Greeve
            timhunt Tim Hunt
            Tim Hunt Tim Hunt
            Damyon Wiese Damyon Wiese
            David Monllaó David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.