Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Tests lock

Copyright: 2012 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 121 lines (4 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 1 file
 lib/testing/lib.php

Defines 1 class

test_lock:: (3 methods):
  acquire()
  release()
  get_lock_handle_name()


Class: test_lock  - X-Ref

Tests lock to prevent concurrent executions of the same test suite

acquire(string $framework, string $lockfilesuffix = '')   X-Ref
Prevent parallel test execution - this can not work in Moodle because we modify database and dataroot.

Note: do not call manually!

return: void
param: string $framework phpunit|behat
param: string $lockfilesuffix A sub-type used by the framework

release(string $framework, string $lockfilesuffix = '')   X-Ref
Note: do not call manually!

return: void
param: string $framework phpunit|behat
param: string $lockfilesuffix A sub-type used by the framework

get_lock_handle_name(string $framework, string $lockfilesuffix)   X-Ref
Get the name of the lock handle stored in the class.

return: string
param: string $framework
param: string $lockfilesuffix