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

Unit test error with tool_httpsreplace on Windows

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Run PHPUnit test for admin/tool/httpsreplace/tests/httpsreplace_test.php on both Windows and Linux.

        vendor/bin/phpunit admin/tool/httpsreplace/tests/httpsreplace_test.php
        

        • Confirm the test passes and that you don't encounter any error.
      Show
      Run PHPUnit test for admin/tool/httpsreplace/tests/httpsreplace_test.php on both Windows and Linux. vendor/bin/phpunit admin/tool/httpsreplace/tests/httpsreplace_test.php Confirm the test passes and that you don't encounter any error.
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-60655-master

      Description

      While running unit tests on Windows, I encountered the following error:

      There was 1 error:
       
      1) tool_httpsreplace\tests\httpsreplace_test::test_upgrade_http_links with data set "Test image from a site with international name should be replaced" ('<img src="http://中国互联网络信息中心.中....png">', '/UPDATE/', '<img src="https://中国互联网络信息中心.....png">')
      dml_write_exception: Error writing to database (SQLState: IMSSP<br>
      Error Code: -46<br>
      Message: An error occurred translating the query string to UTF-16: No mapping for the Unicode character exists in the target multi-byte code page.
      .<br>
       
      UPDATE phpu_course
                             SET summary = REPLACE(summary, N'src="http://中国互联网络信息中心.中姬 N'src="https://中国互联网络信息中心.中姩
                           WHERE summary IS NOT NULL
      [array (
        0 => 'src="http://中国互联网络信息中心.中姬
        1 => 'src="https://中国互联网络信息中心.中姬
      )])
       
      C:\inetpub\wwwroot\integration_master\lib\dml\moodle_database.php:489
      C:\inetpub\wwwroot\integration_master\lib\dml\sqlsrv_native_moodle_database.php:324
      C:\inetpub\wwwroot\integration_master\lib\dml\sqlsrv_native_moodle_database.php:431
      C:\inetpub\wwwroot\integration_master\lib\dml\sqlsrv_native_moodle_database.php:840
      C:\inetpub\wwwroot\integration_master\lib\dml\moodle_database.php:2410
      C:\inetpub\wwwroot\integration_master\admin\tool\httpsreplace\classes\url_finder.php:82
      C:\inetpub\wwwroot\integration_master\admin\tool\httpsreplace\classes\url_finder.php:205
      C:\inetpub\wwwroot\integration_master\admin\tool\httpsreplace\classes\url_finder.php:55
      C:\inetpub\wwwroot\integration_master\admin\tool\httpsreplace\tests\httpsreplace_test.php:141
      C:\inetpub\wwwroot\integration_master\lib\phpunit\classes\advanced_testcase.php:80
       
      To re-run:
       vendor/bin/phpunit tool_httpsreplace\tests\httpsreplace_test admin/tool/httpsreplace/tests/httpsreplace_test.php
      

        Attachments

          Activity

            People

            • Assignee:
              jpataleta Jun Pataleta
              Reporter:
              jpataleta Jun Pataleta
              Peer reviewer:
              Simey Lameze
              Integrator:
              Damyon Wiese
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17