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

Unit test error with tool_httpsreplace on Windows

XMLWordPrintable

    • MOODLE_34_STABLE
    • MOODLE_34_STABLE
    • MDL-60655-master
    • 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.

      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
      

            jpataleta Jun Pataleta
            jpataleta Jun Pataleta
            Simey Lameze Simey Lameze
            Damyon Wiese Damyon Wiese
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            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.