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.

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!

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

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

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

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

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