Tester\Environment::lock PHP Method

lock() public static method

Locks the parallel tests.
public static lock ( $name = '', $path = '' ) : void
return void
    public static function lock($name = '', $path = '')
    {
        static $locks;
        $file = "{$path}/lock-" . md5($name);
        if (!isset($locks[$file])) {
            flock($locks[$file] = fopen($file, 'w'), LOCK_EX);
        }
    }

Usage Example

Ejemplo n.º 1
0
 public function setUp()
 {
     if (static::$serial) {
         // serialize report test because of database connection
         Environment::lock('db', dirname(TEMP_DIR));
     }
 }
All Usage Examples Of Tester\Environment::lock