}
function testPessimisticLock() {
- $this->table->setLock(new Table\PessimisticLock);
+ $this->table->attach(new Table\PessimisticLock);
$txn = $this->table->getConnection()->startTransaction();
$row = $this->table->find(null, null, 1)->current();
$row->data = "foo";
}
function testPessimisticLockFail() {
- $this->table->setLock(new Table\PessimisticLock);
+ $this->table->attach(new Table\PessimisticLock);
$txn = $this->table->getConnection()->startTransaction();
$row = $this->table->find(null, null, 1)->current();
$row->data = "foo";
}
function testOptimisticLock() {
- $this->table->setLock(new Table\OptimisticLock("counter"));
+ $this->table->attach(new Table\OptimisticLock("counter"));
$row = $this->table->find(null, null, 1)->current();
$cnt = $row->counter->get();
$row->data = "foo";
}
function testOptimisticLockFail() {
- $this->table->setLock(new Table\OptimisticLock("counter"));
+ $this->table->attach(new Table\OptimisticLock("counter"));
$row = $this->table->find(null, null, 1)->current();
$row->data = "foo";
executeInConcurrentTransaction(
function testRef() {
foreach ($this->table->find() as $row) {
- foreach ($row->reftest() as $ref) {
- $this->assertEquals($row->id->get(), $ref->test->current()->id->get());
+ foreach ($row->allOf("reftest") as $ref) {
+ $this->assertEquals($row->id->get(), $ref->ofWhich("test")->current()->id->get());
}
}
}