use standard SplObserver
[m6w6/pq-gateway] / tests / lib / pq / Gateway / RowTest.php
index 1d339639c27d5cda471ce5a68589750b9a3e1b23..7b88e1993b298c894b2746622613068aaa684628 100644 (file)
@@ -38,7 +38,9 @@ class RowTest extends \PHPUnit_Framework_TestCase {
                                "created" => new \pq\DateTime("tomorrow"),
                                "counter" => "1",
                                "number" => "1.1",
-                               "data" => "tomorrow"
+                               "data" => "tomorrow",
+                               "list" => array(1,2,3),
+                               "prop" => null
                        ),
                        $row->getData()
                );
@@ -51,7 +53,7 @@ class RowTest extends \PHPUnit_Framework_TestCase {
        }
        
        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";
@@ -61,7 +63,7 @@ class RowTest extends \PHPUnit_Framework_TestCase {
        }
        
        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";
@@ -75,7 +77,7 @@ class RowTest extends \PHPUnit_Framework_TestCase {
        }
        
        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";
@@ -85,7 +87,7 @@ class RowTest extends \PHPUnit_Framework_TestCase {
        }
        
        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(