From: Marcus Boerger Date: Sun, 20 Feb 2005 13:37:04 +0000 (+0000) Subject: - Update test X-Git-Tag: RELEASE_0_3~323 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44ab1ef86cd32af71d15e66f19492aa60c8fa18d;p=php - Update test --- 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===