diff options
author | Marcus Boerger <helly@php.net> | 2005-02-20 13:37:04 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2005-02-20 13:37:04 +0000 |
commit | 44ab1ef86cd32af71d15e66f19492aa60c8fa18d (patch) | |
tree | 264792249f6f29fc4f7baa259505c179c4c964ff /ext/pdo_sqlite | |
parent | 07a8ea220f74077cf7b23b55507a05c66424b98b (diff) | |
download | php-git-44ab1ef86cd32af71d15e66f19492aa60c8fa18d.tar.gz |
- Update test
Diffstat (limited to 'ext/pdo_sqlite')
-rwxr-xr-x | ext/pdo_sqlite/tests/pdo_sqlite_005.phpt | 65 |
1 files changed, 45 insertions, 20 deletions
diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_005.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_005.phpt index 9ea9e2b00b..9def58736a 100755 --- a/ext/pdo_sqlite/tests/pdo_sqlite_005.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_005.phpt @@ -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=== |