Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

DML read/read-write database handle tests for pgsql_native_moodle_database

Copyright: 2018 Srdjan Janković, Catalyst IT
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 201 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/dml/tests/fixtures/read_slave_moodle_database_mock_pgsql.php

Defines 1 class

dml_pgsql_read_slave_test:: (5 methods):
  test_cursors()
  test_read_pg_table()
  test_read_pg_lock_table()
  test_temp_table()
  test_real_readslave_connect_fail()


Class: dml_pgsql_read_slave_test  - X-Ref

DML pgsql_native_moodle_database read slave specific tests

test_cursors()   X-Ref
Test correct database handles are used for cursors

return: void

test_read_pg_table()   X-Ref
Test readonly handle is used for reading from random pg_*() call queries.

return: void

test_read_pg_lock_table()   X-Ref
Test readonly handle is not used for reading from special pg_*() call queries,
pg_try_advisory_lock and pg_advisory_unlock.

return: void

test_temp_table()   X-Ref
Test readonly handle is not used for reading from temptables
and getting temptables metadata.
This test is only possible because of no pg_query error reporting.
It may need to be removed in the future if we decide to handle null
results in pgsql_native_moodle_database differently.

return: void

test_real_readslave_connect_fail()   X-Ref
Test readonly connection failure with real pgsql connection

return: void