trigger mirror
[m6w6/pq-gateway] / tests / lib / pq / Gateway / CellTest.php
index de57a4fbcc7f25e91eaa6628382a88d3599c5adf..35ee6a072504e03d2d5a22b3dd6ffbd9345aac7c 100644 (file)
@@ -55,8 +55,8 @@ class CellTest extends \PHPUnit_Framework_TestCase {
                $rows = $this->table->find(null, "id desc", 2);
                $reft = new Table("reftest");
                $refs = new Rowset($reft);
-               $refs->append($rows->seek(0)->current()->reftest()->current());
-               $refs->append($rows->seek(1)->current()->reftest()->current());
+               $refs->append($rows->seek(0)->current()->allOf("reftest")->current());
+               $refs->append($rows->seek(1)->current()->allOf("reftest")->current());
                $refs->seek(0)->current()->test = $rows->seek(1)->current();
                $refs->seek(1)->current()->test = $rows->seek(0)->current();
                $refs->update();
@@ -77,7 +77,8 @@ class CellTest extends \PHPUnit_Framework_TestCase {
                $row->list = [$row->list->get()];
                $row->update();
                $this->assertEquals([[0,1,2]], $row->list->get());
-               $this->setExpectedException("PHPUnit_Framework_Error_Notice", "Indirect modification of overloaded element of pq\Gateway\Cell has no effect");
+               $this->setExpectedException("PHPUnit_Framework_Error_Notice", 
+                       "Indirect modification of overloaded element of pq\Gateway\Cell has no effect");
                $row->list[0][0] = -1;
        }
                
@@ -99,19 +100,19 @@ class CellTest extends \PHPUnit_Framework_TestCase {
        }       
 }
 
-class Hstore implements \pq\ConverterInterface
+class Hstore implements \pq\Converter
 {
        protected $types;
        function __construct(\pq\Types $types) {
-               $this->types = $types;
+               $this->types = $types["hstore"]->oid;
        }
        function convertTypes() {
-               return [$this->types["hstore"]->oid];
+               return [$this->types];
        }
-       function convertFromString($string) {
+       function convertFromString($string, $type) {
                return eval("return [$string];");
        }
-       function convertToString($data) {
+       function convertToString($data, $type) {
                $string = "";
                foreach ($data as $k => $v) {
                        $string .= "\"".addslashes($k)."\"=>";