/** * @covers ::requestAdvisoryLock * @covers ::releaseAdvisoryLocks */ public function testAnAdvisoryLockCanBeReleased() { $this->assertTrue($this->database->requestAdvisoryLock(1, 'test', 'lock')); $this->assertFalse($this->database->requestAdvisoryLock(2, 'test', 'lock')); $this->assertFalse($this->database->requestAdvisoryLock(3, 'test', 'lock')); $this->database->releaseAdvisoryLocks(1); $this->database->releaseAdvisoryLocks(3); $this->assertTrue($this->database->requestAdvisoryLock(2, 'test', 'lock')); $this->assertFalse($this->database->requestAdvisoryLock(1, 'test', 'lock')); $this->assertFalse($this->database->requestAdvisoryLock(3, 'test', 'lock')); }
public function __destruct() { $this->database->releaseAdvisoryLocks($this->connection_id); }