]> granicus.if.org Git - php/commitdiff
- Update test
authorMarcus Boerger <helly@php.net>
Sun, 20 Feb 2005 13:37:04 +0000 (13:37 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 20 Feb 2005 13:37:04 +0000 (13:37 +0000)
ext/pdo_sqlite/tests/pdo_sqlite_005.phpt

index 9ea9e2b00b45340849a2103056b358ff5e8c8ee5..9def58736af2859885a35d94489d647eec103bce 100755 (executable)
@@ -8,15 +8,16 @@ if (!extension_loaded("pdo_sqlite")) print "skip"; ?>
 
 $db =new pdo('sqlite::memory:');
 
-$db->exec('CREATE TABLE test(id int PRIMARY KEY, val VARCHAR(10))');
-$db->exec('INSERT INTO test VALUES(1, "A")'); 
-$db->exec('INSERT INTO test VALUES(2, "B")'); 
-$db->exec('INSERT INTO test VALUES(3, "C")'); 
+$db->exec('CREATE TABLE test(id int PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(10))');
+$db->exec('INSERT INTO test VALUES(1, "A", "AA")'); 
+$db->exec('INSERT INTO test VALUES(2, "B", "BB")'); 
+$db->exec('INSERT INTO test VALUES(3, "C", "CC")'); 
 
 class TestBase
 {
        public $id;
-       public $val;
+       protected $val;
+       private $val2;
 }
 
 class TestDerived extends TestBase
@@ -40,83 +41,107 @@ var_dump($db->query('SELECT * FROM test')->fetchAll(PDO_FETCH_CLASS, 'TestDerive
 --EXPECTF--
 array(3) {
   [0]=>
-  object(stdClass)#%d (2) {
+  object(stdClass)#%d (3) {
     ["id"]=>
     string(1) "1"
     ["val"]=>
     string(1) "A"
+    ["val2"]=>
+    string(2) "AA"
   }
   [1]=>
-  object(stdClass)#%d (2) {
+  object(stdClass)#%d (3) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
     string(1) "B"
+    ["val2"]=>
+    string(2) "BB"
   }
   [2]=>
-  object(stdClass)#%d (2) {
+  object(stdClass)#%d (3) {
     ["id"]=>
     string(1) "3"
     ["val"]=>
     string(1) "C"
+    ["val2"]=>
+    string(2) "CC"
   }
 }
 array(3) {
   [0]=>
-  object(TestBase)#%d (2) {
+  object(TestBase)#%d (3) {
     ["id"]=>
     string(1) "1"
-    ["val"]=>
+    ["val:protected"]=>
     string(1) "A"
+    ["val2:private"]=>
+    string(2) "AA"
   }
   [1]=>
-  object(TestBase)#%d (2) {
+  object(TestBase)#%d (3) {
     ["id"]=>
     string(1) "2"
-    ["val"]=>
+    ["val:protected"]=>
     string(1) "B"
+    ["val2:private"]=>
+    string(2) "BB"
   }
   [2]=>
-  object(TestBase)#%d (2) {
+  object(TestBase)#%d (3) {
     ["id"]=>
     string(1) "3"
-    ["val"]=>
+    ["val:protected"]=>
     string(1) "C"
+    ["val2:private"]=>
+    string(2) "CC"
   }
 }
 array(3) {
   [0]=>
-  object(TestDerived)#%d (4) {
+  object(TestDerived)#%d (6) {
     ["p1:protected"]=>
     int(1)
     ["p2:protected"]=>
     int(2)
     ["id"]=>
     string(1) "1"
-    ["val"]=>
+    ["val:protected"]=>
     string(1) "A"
+    ["val2:private"]=>
+    NULL
+    ["val2"]=>
+    string(2) "AA"
   }
   [1]=>
-  object(TestDerived)#%d (4) {
+  object(TestDerived)#%d (6) {
     ["p1:protected"]=>
     int(1)
     ["p2:protected"]=>
     int(2)
     ["id"]=>
     string(1) "2"
-    ["val"]=>
+    ["val:protected"]=>
     string(1) "B"
+    ["val2:private"]=>
+    NULL
+    ["val2"]=>
+    string(2) "BB"
   }
   [2]=>
-  object(TestDerived)#%d (4) {
+  object(TestDerived)#%d (6) {
     ["p1:protected"]=>
     int(1)
     ["p2:protected"]=>
     int(2)
     ["id"]=>
     string(1) "3"
-    ["val"]=>
+    ["val:protected"]=>
     string(1) "C"
+    ["val2:private"]=>
+    NULL
+    ["val2"]=>
+    string(2) "CC"
   }
 }
 ===DONE===