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

test_moodle_read_slave_trait sets db handle to string

XMLWordPrintable

      trait test_moodle_read_slave_trait sets db handle to string instead of a resource and it breaks tests under PHP8 completely:

      1) core_dml_pgsql_read_slave_testcase::test_temp_table
      TypeError: pg_query(): Argument #1 ($connection) must be of type resource, string given
       
      /var/www/html/lib/dml/pgsql_native_moodle_database.php:395
      /var/www/html/lib/ddl/sql_generator.php:234
      /var/www/html/lib/ddl/database_manager.php:100
      /var/www/html/lib/ddl/database_manager.php:462
      /var/www/html/lib/dml/tests/dml_pgsql_read_slave_test.php:129
       
      2) core_dml_pgsql_read_slave_testcase::test_real_readslave_connect_fail
      TypeError: pg_connection_status(): Argument #1 ($connection) must be of type resource, bool given
       
      /var/www/html/lib/dml/pgsql_native_moodle_database.php:195
      /var/www/html/lib/dml/moodle_read_slave_trait.php:200
      /var/www/html/lib/dml/tests/dml_pgsql_read_slave_test.php:159
       
      3) backup_logger_testcase::test_file_logger
      TypeError: fwrite(): Argument #1 ($stream) must be of type resource, null given
       
      /var/www/html/backup/util/loggers/file_logger.class.php:100
      /var/www/html/backup/util/loggers/base_logger.class.php:119
      /var/www/html/backup/util/loggers/tests/logger_test.php:309
      /var/www/html/lib/phpunit/classes/basic_testcase.php:64
      

        1. 0001-70965-wip.patch
          5 kB
          Andrew Lyons
        2. test.err
          16 kB
          Srdjan Jankovic

            srdjan Srdjan Jankovic
            marina Marina Glancy
            Marina Glancy Marina Glancy
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 40 minutes
                5h 40m

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