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

test_moodle_read_slave_trait sets db handle to string

    XMLWordPrintable

    Details

      Description

      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
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              srdjan Srdjan Jankovic
              Reporter:
              marina Marina Glancy
              Peer reviewer:
              Marina Glancy Marina Glancy
              Integrator:
              Andrew Lyons Andrew Lyons
              Tester:
              CiBoT CiBoT
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/21

                  Time Tracking

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