コード例 #1
0
ファイル: DatabaseTest.php プロジェクト: lightster/hodor
 /**
  * @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'));
 }
コード例 #2
0
ファイル: Superqueuer.php プロジェクト: lightster/hodor
 public function __destruct()
 {
     $this->database->releaseAdvisoryLocks($this->connection_id);
 }