Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are 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