From 5fe199fb0fb71bab90a293fafb2ac2b3a37bbbba Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 7 Jul 2005 15:36:00 +0000 Subject: [PATCH] remove old test files --- ext/pdo/tests/pdo_001.inc | 20 ----- ext/pdo/tests/pdo_002.inc | 21 ----- ext/pdo/tests/pdo_003.inc | 20 ----- ext/pdo/tests/pdo_004.inc | 20 ----- ext/pdo/tests/pdo_005.inc | 38 --------- ext/pdo/tests/pdo_006.inc | 20 ----- ext/pdo/tests/pdo_007.inc | 19 ----- ext/pdo/tests/pdo_008.inc | 19 ----- ext/pdo/tests/pdo_009.inc | 53 ------------ ext/pdo/tests/pdo_010.inc | 53 ------------ ext/pdo/tests/pdo_011.inc | 67 --------------- ext/pdo/tests/pdo_012.inc | 32 -------- ext/pdo/tests/pdo_013.inc | 39 --------- ext/pdo/tests/pdo_014.inc | 61 -------------- ext/pdo/tests/pdo_015.inc | 25 ------ ext/pdo/tests/pdo_016.inc | 82 ------------------- ext/pdo/tests/pdo_017.inc | 32 -------- ext/pdo/tests/pdo_018.inc | 149 ---------------------------------- ext/pdo/tests/pdo_019.inc | 36 -------- ext/pdo/tests/pdo_020.inc | 28 ------- ext/pdo/tests/pdo_021.inc | 42 ---------- ext/pdo/tests/pdo_022.inc | 41 ---------- ext/pdo/tests/pdo_023.inc | 26 ------ ext/pdo/tests/pdo_023_def.inc | 46 ----------- ext/pdo/tests/pdo_024.inc | 21 ----- ext/pdo/tests/pdo_025.inc | 51 ------------ ext/pdo/tests/pdo_026.inc | 69 ---------------- 27 files changed, 1130 deletions(-) delete mode 100755 ext/pdo/tests/pdo_001.inc delete mode 100755 ext/pdo/tests/pdo_002.inc delete mode 100755 ext/pdo/tests/pdo_003.inc delete mode 100755 ext/pdo/tests/pdo_004.inc delete mode 100755 ext/pdo/tests/pdo_005.inc delete mode 100755 ext/pdo/tests/pdo_006.inc delete mode 100755 ext/pdo/tests/pdo_007.inc delete mode 100755 ext/pdo/tests/pdo_008.inc delete mode 100755 ext/pdo/tests/pdo_009.inc delete mode 100755 ext/pdo/tests/pdo_010.inc delete mode 100755 ext/pdo/tests/pdo_011.inc delete mode 100755 ext/pdo/tests/pdo_012.inc delete mode 100755 ext/pdo/tests/pdo_013.inc delete mode 100755 ext/pdo/tests/pdo_014.inc delete mode 100755 ext/pdo/tests/pdo_015.inc delete mode 100755 ext/pdo/tests/pdo_016.inc delete mode 100755 ext/pdo/tests/pdo_017.inc delete mode 100755 ext/pdo/tests/pdo_018.inc delete mode 100755 ext/pdo/tests/pdo_019.inc delete mode 100755 ext/pdo/tests/pdo_020.inc delete mode 100755 ext/pdo/tests/pdo_021.inc delete mode 100755 ext/pdo/tests/pdo_022.inc delete mode 100755 ext/pdo/tests/pdo_023.inc delete mode 100755 ext/pdo/tests/pdo_023_def.inc delete mode 100755 ext/pdo/tests/pdo_024.inc delete mode 100755 ext/pdo/tests/pdo_025.inc delete mode 100755 ext/pdo/tests/pdo_026.inc diff --git a/ext/pdo/tests/pdo_001.inc b/ext/pdo/tests/pdo_001.inc deleted file mode 100755 index 68c61a1746f..00000000000 --- a/ext/pdo/tests/pdo_001.inc +++ /dev/null @@ -1,20 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); - -$stmt = $DB->query($SQL['select']); - -var_dump($stmt->fetchAll(PDO_FETCH_ASSOC)); -?> diff --git a/ext/pdo/tests/pdo_002.inc b/ext/pdo/tests/pdo_002.inc deleted file mode 100755 index c1bb2b51147..00000000000 --- a/ext/pdo/tests/pdo_002.inc +++ /dev/null @@ -1,21 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); - -$stmt = $DB->query($SQL['select']); - -var_dump($stmt->fetchAll(PDO_FETCH_NUM)); - -?> diff --git a/ext/pdo/tests/pdo_003.inc b/ext/pdo/tests/pdo_003.inc deleted file mode 100755 index 3752a9ad4ef..00000000000 --- a/ext/pdo/tests/pdo_003.inc +++ /dev/null @@ -1,20 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); - -$stmt = $DB->query($SQL['select']); - -var_dump($stmt->fetchAll(PDO_FETCH_BOTH)); -?> diff --git a/ext/pdo/tests/pdo_004.inc b/ext/pdo/tests/pdo_004.inc deleted file mode 100755 index 6851ec4ef6e..00000000000 --- a/ext/pdo/tests/pdo_004.inc +++ /dev/null @@ -1,20 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); - -$stmt = $DB->query($SQL['select']); - -var_dump($stmt->fetchAll(PDO_FETCH_OBJ)); -?> diff --git a/ext/pdo/tests/pdo_005.inc b/ext/pdo/tests/pdo_005.inc deleted file mode 100755 index 01649b2cc3c..00000000000 --- a/ext/pdo/tests/pdo_005.inc +++ /dev/null @@ -1,38 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); - -class TestBase -{ - public $id; - protected $val; - private $val2; -} - -class TestDerived extends TestBase -{ - protected $row; - - public function __construct(&$row) - { - echo __METHOD__ . "($row,{$this->id})\n"; - $this->row = $row++; - } -} - -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_CLASS)); -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_CLASS, 'TestBase')); -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_CLASS, 'TestDerived', array(0))); -?> diff --git a/ext/pdo/tests/pdo_006.inc b/ext/pdo/tests/pdo_006.inc deleted file mode 100755 index 30c780bc790..00000000000 --- a/ext/pdo/tests/pdo_006.inc +++ /dev/null @@ -1,20 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); - -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_NUM|PDO_FETCH_GROUP)); -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_ASSOC|PDO_FETCH_GROUP)); - -?> diff --git a/ext/pdo/tests/pdo_007.inc b/ext/pdo/tests/pdo_007.inc deleted file mode 100755 index 265ffab85c6..00000000000 --- a/ext/pdo/tests/pdo_007.inc +++ /dev/null @@ -1,19 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); - -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_NUM|PDO_FETCH_UNIQUE)); -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_ASSOC|PDO_FETCH_UNIQUE)); - -?> diff --git a/ext/pdo/tests/pdo_008.inc b/ext/pdo/tests/pdo_008.inc deleted file mode 100755 index 561ebd2a6d8..00000000000 --- a/ext/pdo/tests/pdo_008.inc +++ /dev/null @@ -1,19 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); - -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_NUM|PDO_FETCH_UNIQUE)); -// check that repeated first columns overwrite existing array elements - -?> diff --git a/ext/pdo/tests/pdo_009.inc b/ext/pdo/tests/pdo_009.inc deleted file mode 100755 index d54aa61a661..00000000000 --- a/ext/pdo/tests/pdo_009.inc +++ /dev/null @@ -1,53 +0,0 @@ -exec($SQL['create1']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); -$DB->exec($SQL['create2']); -$DB->exec($SQL['insert4']); -$DB->exec($SQL['insert5']); -$DB->exec($SQL['insert6']); -$DB->exec($SQL['insert7']); - -class Test1 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -class Test2 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -class Test3 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_NUM)); -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_CLASS|PDO_FETCH_CLASSTYPE, 'Test3')); - -?> diff --git a/ext/pdo/tests/pdo_010.inc b/ext/pdo/tests/pdo_010.inc deleted file mode 100755 index 2e4c943508a..00000000000 --- a/ext/pdo/tests/pdo_010.inc +++ /dev/null @@ -1,53 +0,0 @@ -exec($SQL['create1']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); -$DB->exec($SQL['create2']); -$DB->exec($SQL['insert4']); -$DB->exec($SQL['insert5']); -$DB->exec($SQL['insert6']); -$DB->exec($SQL['insert7']); - -class Test1 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -class Test2 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -class Test3 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_CLASS|PDO_FETCH_CLASSTYPE|PDO_FETCH_GROUP, 'Test3')); -var_dump($DB->query($SQL['select'])->fetchAll(PDO_FETCH_CLASS|PDO_FETCH_CLASSTYPE|PDO_FETCH_UNIQUE, 'Test3')); - -?> diff --git a/ext/pdo/tests/pdo_011.inc b/ext/pdo/tests/pdo_011.inc deleted file mode 100755 index 896abb3575b..00000000000 --- a/ext/pdo/tests/pdo_011.inc +++ /dev/null @@ -1,67 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); -$DB->exec($SQL['insert4']); - -class Test1 -{ - public function __construct($id, $val) - { - echo __METHOD__ . "($id,$val)\n"; - $this->id = $id; - $this->val = $val; - } - - static public function factory($id, $val) - { - echo __METHOD__ . "($id,$val)\n"; - return new self($id, $val); - } -} - -function test($id,$val='N/A') -{ - echo __METHOD__ . "($id,$val)\n"; - return array($id=>$val); -} - -$f = new Test1(0,0); - -var_dump($DB->query($SQL['select1'])->fetchAll(PDO_FETCH_FUNC|PDO_FETCH_GROUP, 'test')); -var_dump($DB->query($SQL['select2'])->fetchAll(PDO_FETCH_FUNC, 'test')); -var_dump($DB->query($SQL['select2'])->fetchAll(PDO_FETCH_FUNC, array('Test1','factory'))); -var_dump($DB->query($SQL['select2'])->fetchAll(PDO_FETCH_FUNC, array($f, 'factory'))); - -class DerivedStatement extends PDOStatement -{ - private function __construct($name, $db) - { - $this->name = $name; - echo __METHOD__ . "($name)\n"; - } - - function retrieve($id, $val) { - echo __METHOD__ . "($id,$val)\n"; - return array($id=>$val); - } -} - -$stmt = $DB->prepare($SQL['select2'], array(PDO_ATTR_STATEMENT_CLASS=>array('DerivedStatement', array('Overloaded', $DB)))); -var_dump(get_class($stmt)); -$stmt->execute(); -var_dump($stmt->fetchAll(PDO_FETCH_FUNC, array($stmt, 'retrieve'))); - -?> diff --git a/ext/pdo/tests/pdo_012.inc b/ext/pdo/tests/pdo_012.inc deleted file mode 100755 index ee07b411436..00000000000 --- a/ext/pdo/tests/pdo_012.inc +++ /dev/null @@ -1,32 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); - -$stmt = $DB->query($SQL['select1'], PDO_FETCH_NUM); -var_dump($stmt->fetchAll()); - -class Test -{ - function __construct($name = 'N/A') - { - echo __METHOD__ . "($name)\n"; - } -} - -$stmt = $DB->query($SQL['select1'], PDO_FETCH_CLASS, 'Test'); -var_dump($stmt->fetchAll()); - -$stmt = $DB->query($SQL['select1'], PDO_FETCH_NUM); -$stmt->setFetchMode(PDO_FETCH_CLASS, 'Test', array('Changed')); -var_dump($stmt->fetchAll()); - -?> diff --git a/ext/pdo/tests/pdo_013.inc b/ext/pdo/tests/pdo_013.inc deleted file mode 100755 index 359c2b1cb69..00000000000 --- a/ext/pdo/tests/pdo_013.inc +++ /dev/null @@ -1,39 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); - -foreach($DB->query($SQL['select1'], PDO_FETCH_NUM) as $data) -{ - var_dump($data); -} - -class Test -{ - function __construct($name = 'N/A') - { - echo __METHOD__ . "($name)\n"; - } -} - -foreach($DB->query($SQL['select1'], PDO_FETCH_CLASS, 'Test') as $data) -{ - var_dump($data); -} - -$stmt = $DB->query($SQL['select1'], PDO_FETCH_CLASS, 'Test', array('WOW')); - -foreach($stmt as $data) -{ - var_dump($data); -} - -?> diff --git a/ext/pdo/tests/pdo_014.inc b/ext/pdo/tests/pdo_014.inc deleted file mode 100755 index fe4e435e4e4..00000000000 --- a/ext/pdo/tests/pdo_014.inc +++ /dev/null @@ -1,61 +0,0 @@ -exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); - -class Test -{ - function __construct($name = 'N/A') - { - echo __METHOD__ . "($name)\n"; - } -} - -$stmt = $DB->query($SQL['select1'], PDO_FETCH_CLASS, 'Test', array('WOW')); - -$it = new IteratorIterator($stmt); /* check if we can convert that thing */ - -/*** HINT: If YOU plan to do so remember not to call rewind() -> see below ***/ - -foreach($it as $data) -{ - var_dump($data); -} - -$it->next(); /* must be allowed */ -var_dump($it->current()); /* must return NULL */ -var_dump($it->valid()); /* must return false */ - -class PDOStatementAggregate extends PDOStatement implements IteratorAggregate -{ - private function __construct() - { - echo __METHOD__ . "\n"; - $this->setFetchMode(PDO_FETCH_NUM); - /* default fetch mode is BOTH, so we see if the ctor can overwrite that */ - } - - function getIterator() - { - echo __METHOD__ . "\n"; - $this->execute(); - return new IteratorIterator($this, 'PDOStatement'); - } -} - -$stmt = $DB->prepare($SQL['select1'], array(PDO_ATTR_STATEMENT_CLASS=>array('PDOStatementAggregate'))); - -foreach($stmt as $data) -{ - var_dump($data); -} - -?> diff --git a/ext/pdo/tests/pdo_015.inc b/ext/pdo/tests/pdo_015.inc deleted file mode 100755 index cbcfb587dca..00000000000 --- a/ext/pdo/tests/pdo_015.inc +++ /dev/null @@ -1,25 +0,0 @@ -exec($SQL['create1']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); - -var_dump($DB->query($SQL['select1'])->fetchAll(PDO_FETCH_COLUMN)); -var_dump($DB->query($SQL['select1'])->fetchAll(PDO_FETCH_COLUMN, 2)); -var_dump($DB->query($SQL['select1'])->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_GROUP)); -var_dump($DB->query($SQL['select1'])->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_UNIQUE)); -var_dump($DB->query($SQL['select1'])->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_UNIQUE, 0)); -var_dump($DB->query($SQL['select1'])->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_UNIQUE, 1)); -var_dump($DB->query($SQL['select1'])->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_UNIQUE, 2)); -var_dump($DB->query($SQL['select2'])->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_GROUP)); - -?> diff --git a/ext/pdo/tests/pdo_016.inc b/ext/pdo/tests/pdo_016.inc deleted file mode 100755 index 09d43d93d9b..00000000000 --- a/ext/pdo/tests/pdo_016.inc +++ /dev/null @@ -1,82 +0,0 @@ -exec($SQL['create1']); -var_dump($DB->exec($SQL['insert1'])); -var_dump($DB->exec($SQL['insert2'])); -var_dump($DB->exec($SQL['insert3'])); -var_dump($DB->query($SQL['select1'])->fetchColumn()); - -$cont = $DB->query($SQL['select2'])->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_UNIQUE); -var_dump($cont); - -echo "===WHILE===\n"; - -$stmt2 = $DB->prepare($SQL['select2']); -$stmt2->bindColumn('idx', $idx); -$stmt2->bindColumn('txt', $txt); -$stmt2->execute(); - -while($stmt2->fetch(PDO_FETCH_BOUND)) { - var_dump(array($idx=>$txt)); -} - -echo "===ALONE===\n"; - -$stmt3 = $DB->prepare($SQL['select3']); -$stmt3->bindParam(':inp', $idx); /* by foreign name */ -$stmt3->bindColumn('txt', $col1); - -$stmt4 = $DB->prepare($SQL['select4']); -$stmt4->bindParam(':txt', $txt); /* using same name */ -$stmt4->bindColumn('idx', $col2); - -foreach($cont as $idx => $txt) -{ - var_dump(array($idx=>$txt)); - var_dump($stmt3->execute()); - var_dump($stmt3->fetch(PDO_FETCH_BOUND)); - var_dump($stmt4->execute()); - var_dump($stmt4->fetch(PDO_FETCH_BOUND)); - var_dump(array($col2=>$col1)); -} - -echo "===REBIND/SAME===\n"; - -$stmt4->bindColumn('idx', $col1); - -foreach($cont as $idx => $txt) -{ - var_dump(array($idx=>$txt)); - var_dump($stmt3->execute()); - var_dump($stmt3->fetch(PDO_FETCH_BOUND)); - var_dump($col1); - var_dump($stmt4->execute()); - var_dump($stmt4->fetch(PDO_FETCH_BOUND)); - var_dump($col1); -} - -echo "===REBIND/CONFLICT===\n"; - -$stmt2->bindColumn('idx', $col1); -$stmt2->bindColumn('txt', $col1); -$stmt2->execute(); - -while($stmt2->fetch(PDO_FETCH_BOUND)) -{ - var_dump($col1); -} - -?> diff --git a/ext/pdo/tests/pdo_017.inc b/ext/pdo/tests/pdo_017.inc deleted file mode 100755 index 7a2fe4739ee..00000000000 --- a/ext/pdo/tests/pdo_017.inc +++ /dev/null @@ -1,32 +0,0 @@ -query($SQL['select']); - $res = $stmt->fetchColumn(); - return "Counted $res rows after $action.\n"; -} - -$DB->exec($SQL['create']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); - -echo countRows($DB, 'insert'); - -$DB->beginTransaction(); -$DB->exec($SQL['delete']); -echo countRows($DB, 'delete'); -$DB->rollBack(); - -echo countRows($DB, 'rollback'); -?> diff --git a/ext/pdo/tests/pdo_018.inc b/ext/pdo/tests/pdo_018.inc deleted file mode 100755 index 03bc1eb0ec6..00000000000 --- a/ext/pdo/tests/pdo_018.inc +++ /dev/null @@ -1,149 +0,0 @@ - $val) { - $serialized[$prop] = $val; - } - $serialized = serialize($serialized); - echo __METHOD__ . "() = '$serialized'\n"; - return $serialized; - } - - function unserialize($serialized) - { - echo __METHOD__ . '[' . __LINE__ . ']' . "($serialized)\n"; - foreach(unserialize($serialized) as $prop => $val) { - $this->$prop = '#'.$val; - } - return true; - } -} - -class TestDerived extends TestBase -{ - public $BasePub = 'DerivedPublic'; - protected $BasePro = 'DerivdeProtected'; - public $DerivedPub = 'Public'; - protected $DerivedPro = 'Protected'; - private $DerivedPri = 'Private'; - - function serialize() - { - echo __METHOD__ . "()\n"; - return TestBase::serialize(); - } - - function unserialize($serialized) - { - echo __METHOD__ . "()\n"; - return TestBase::unserialize($serialized); - } -} - -class TestLeaf extends TestDerived -{ -} - -require_once('pdo.inc'); - -set_sql('create1', 'CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name VARCHAR(20) UNIQUE)'); -set_sql('insert1', 'INSERT INTO classtypes VALUES(0, \'stdClass\')'); -set_sql('insert2', 'INSERT INTO classtypes VALUES(1, \'TestBase\')'); -set_sql('insert3', 'INSERT INTO classtypes VALUES(2, \'TestDerived\')'); -set_sql('selectC', 'SELECT COUNT(*) FROM classtypes'); -set_sql('select0', 'SELECT id, name FROM classtypes ORDER by id'); -set_sql('create2', 'CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(255))'); -set_sql('insert4', 'INSERT INTO test VALUES(:id, :classtype, :val)'); -set_sql('select1', 'SELECT id FROM classtypes WHERE name=:cname'); -set_sql('select2', 'SELECT test.val FROM test'); -set_sql('select3', 'SELECT classtypes.name AS name, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id'); -set_sql('select4', 'SELECT COUNT(*) FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id WHERE (classtypes.id IS NULL OR classtypes.id > 0)'); -set_sql('select5', 'SELECT classtypes.name AS name, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id WHERE (classtypes.id IS NULL OR classtypes.id > 0)'); - -$DB->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_EXCEPTION); - -echo "===INIT===\n"; -$DB->exec($SQL['create1']); -var_dump($DB->exec($SQL['insert1'])); -var_dump($DB->exec($SQL['insert2'])); -var_dump($DB->exec($SQL['insert3'])); -$DB->exec($SQL['create2']); -var_dump($DB->query($SQL['selectC'])->fetchColumn()); -var_dump($DB->query($SQL['select0'])->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_UNIQUE)); - -$objs = array(); -$objs[0] = new stdClass; -$objs[1] = new TestBase; -$objs[2] = new TestDerived; -$objs[3] = new TestLeaf; - -$stmt = $DB->prepare($SQL['select1']); -$stmt->bindParam(':cname', $cname); -$stmt->bindColumn('id', $ctype); - -$ctypes = array(); - -foreach($objs as $obj) -{ - $cname = get_class($obj); - $ctype = NULL; /* set default for non stored class name */ - $stmt->execute(); - $stmt->fetch(PDO_FETCH_BOUND); - $ctypes[$cname] = $ctype; -} - -echo "===TYPES===\n"; -var_dump($ctypes); - -echo "===INSERT===\n"; -$stmt = $DB->prepare($SQL['insert4']); -$stmt->bindParam(':id', $idx); -$stmt->bindParam(':classtype', $ctype); -$stmt->bindParam(':val', $val); - -foreach($objs as $idx => $obj) -{ - $ctype = $ctypes[get_class($obj)]; - if (method_exists($obj, 'serialize')) - { - $val = $obj->serialize(); - } - else - { - $val = NULL; - } - $stmt->execute(); -} - -echo "===DATA===\n"; -var_dump($DB->query($SQL['select2'])->fetchAll(PDO_FETCH_COLUMN)); - -echo "===FAILURE===\n"; -try -{ - $DB->query($SQL['select3'])->fetchAll(PDO_FETCH_CLASS|PDO_FETCH_CLASSTYPE|PDO_FETCH_SERIALIZE, 'TestLeaf', array()); -} -catch (PDOException $e) -{ - echo 'Exception:'; - echo $e->getMessage()."\n"; -} - -echo "===COUNT===\n"; -var_dump($DB->query($SQL['select4'])->fetchColumn()); - -echo "===DATABASE===\n"; -var_dump($DB->query($SQL['select5'])->fetchAll(PDO_FETCH_ASSOC)); - -echo "===FETCHCLASS===\n"; -var_dump($DB->query($SQL['select5'])->fetchAll(PDO_FETCH_CLASS|PDO_FETCH_CLASSTYPE|PDO_FETCH_SERIALIZE, 'TestLeaf')); - -?> diff --git a/ext/pdo/tests/pdo_019.inc b/ext/pdo/tests/pdo_019.inc deleted file mode 100755 index f9c81a251f7..00000000000 --- a/ext/pdo/tests/pdo_019.inc +++ /dev/null @@ -1,36 +0,0 @@ -exec($SQL['create1']); -var_dump($DB->exec($SQL['insert1'])); -var_dump($DB->exec($SQL['insert2'])); -var_dump($DB->exec($SQL['insert3'])); -var_dump($DB->exec($SQL['insert4'])); -var_dump($DB->query($SQL['select1'])->fetchColumn()); - -$cont = $DB->query($SQL['select2'])->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_UNIQUE); -var_dump($cont); - -echo "===WHILE===\n"; - -$stmt2 = $DB->prepare($SQL['select2']); -$stmt2->bindColumn('idx', $idx); -$stmt2->bindColumn('txt', $txt); -$stmt2->execute(); - -while($stmt2->fetch(PDO_FETCH_BOUND)) { - var_dump(array($idx=>$txt)); -} - -?> diff --git a/ext/pdo/tests/pdo_020.inc b/ext/pdo/tests/pdo_020.inc deleted file mode 100755 index b04eba26d8d..00000000000 --- a/ext/pdo/tests/pdo_020.inc +++ /dev/null @@ -1,28 +0,0 @@ -query($SQL[$action]); - $res = $stmt->columnCount(); - return "Counted $res columns after $action.\n"; -} - -$DB->exec($SQL['create1']); -$DB->exec($SQL['insert1']); -$DB->exec($SQL['insert2']); -$DB->exec($SQL['insert3']); - -echo countColumns($DB, 'select1'); -echo countColumns($DB, 'select2'); -echo countColumns($DB, 'select3'); -?> diff --git a/ext/pdo/tests/pdo_021.inc b/ext/pdo/tests/pdo_021.inc deleted file mode 100755 index a566087f9d5..00000000000 --- a/ext/pdo/tests/pdo_021.inc +++ /dev/null @@ -1,42 +0,0 @@ -exec($SQL['create1']); - -// Insert using question mark placeholders -$stmt = $DB->prepare($SQL['insert1']); -foreach ($data as $row) { - $stmt->execute($row); -} - -$select = $DB->query($SQL['select']); -$num = $select->fetchColumn(); -echo 'There are ' . $num . " rows in the table.\n"; - -// Insert using named parameters -$stmt2 = $DB->prepare($SQL['insert2']); -foreach ($data as $row) { - $stmt2->execute(array(':first'=>($row[0] + 5), ':second'=>$row[1], - ':third'=>$row[2])); -} - -$select = $DB->query($SQL['select']); -$num = $select->fetchColumn(); -echo 'There are ' . $num . " rows in the table.\n"; - -?> diff --git a/ext/pdo/tests/pdo_022.inc b/ext/pdo/tests/pdo_022.inc deleted file mode 100755 index 6cf662e7a7f..00000000000 --- a/ext/pdo/tests/pdo_022.inc +++ /dev/null @@ -1,41 +0,0 @@ -exec($SQL['create1']); - -// Insert using question mark placeholders -$stmt = $DB->prepare($SQL['insert1']); -foreach ($data as $row) { - $stmt->execute($row); -} - -// Retrieve column metadata for a result set returned by explicit SELECT -$select = $DB->query($SQL['select1']); -$meta = $select->getColumnMeta(0); -var_dump($meta); -$meta = $select->getColumnMeta(1); -var_dump($meta); -$meta = $select->getColumnMeta(2); -var_dump($meta); - -// Retrieve column metadata for a result set returned by a function -$select = $DB->query($SQL['select2']); -$meta = $select->getColumnMeta(0); -var_dump($meta); -?> diff --git a/ext/pdo/tests/pdo_023.inc b/ext/pdo/tests/pdo_023.inc deleted file mode 100755 index d42ccc74380..00000000000 --- a/ext/pdo/tests/pdo_023.inc +++ /dev/null @@ -1,26 +0,0 @@ -test(); - -var_dump($DB); - -$DB->query($SQL['create1']); -$DB->query($SQL['insert1']); -$DB->query($SQL['insert2']); - -$stmt = $DB->query($SQL['select1']); - -var_dump($stmt); -var_dump($stmt->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_UNIQUE)); - -$stmt = NULL; -$DB = NULL; - -?> diff --git a/ext/pdo/tests/pdo_023_def.inc b/ext/pdo/tests/pdo_023_def.inc deleted file mode 100755 index 1fb19809957..00000000000 --- a/ext/pdo/tests/pdo_023_def.inc +++ /dev/null @@ -1,46 +0,0 @@ -test2 = 2; - $this->test2 = 22; - echo __METHOD__ . "()\n"; - } - - function __destruct() - { - echo __METHOD__ . "()\n"; - } -} - -class PDODatabaseX extends PDO -{ - public $test1 = 1; - - function __destruct() - { - echo __METHOD__ . "()\n"; - } - - function test() - { - $this->test2 = 2; - var_dump($this->test1); - var_dump($this->test2); - $this->test2 = 22; - } - - function query($sql) - { - echo __METHOD__ . "()\n"; - $stmt = parent::prepare($sql, array(PDO_ATTR_STATEMENT_CLASS=>array('PDOStatementx'))); - $stmt->execute(); - return $stmt; - } -} - -?> diff --git a/ext/pdo/tests/pdo_024.inc b/ext/pdo/tests/pdo_024.inc deleted file mode 100755 index a3fe3a49691..00000000000 --- a/ext/pdo/tests/pdo_024.inc +++ /dev/null @@ -1,21 +0,0 @@ -query($SQL['create']); -$stmt = $DB->prepare($SQL['insert']); -$name = NULL; -$before_bind = $name; -$stmt->bindParam(':name', $name); -if ($name !== $before_bind) { - echo "bind: fail\n"; -} else { - echo "bind: success\n"; -} -var_dump($stmt->execute()); -var_dump($DB->query($SQL['select'])->fetchColumn()); -?> diff --git a/ext/pdo/tests/pdo_025.inc b/ext/pdo/tests/pdo_025.inc deleted file mode 100755 index 16b861975ed..00000000000 --- a/ext/pdo/tests/pdo_025.inc +++ /dev/null @@ -1,51 +0,0 @@ -exec($SQL['create1']); - -// Insert using question mark placeholders -$stmt = $DB->prepare($SQL['insert1']); -foreach ($data as $row) { - $stmt->execute($row); -} - -class Test { - public $id, $val, $val2; -} - -$stmt = $DB->prepare($SQL['select']); -$stmt->setFetchMode(PDO_FETCH_INTO, new Test); -$stmt->execute(); - -foreach($stmt as $obj) { - var_dump($obj); -} - -echo "===FAIL===\n"; - -class Fail { - protected $id; - public $val, $val2; -} - -$stmt->setFetchMode(PDO_FETCH_INTO, new Fail); -$stmt->execute(); - -foreach($stmt as $obj) { - var_dump($obj); -} -?> diff --git a/ext/pdo/tests/pdo_026.inc b/ext/pdo/tests/pdo_026.inc deleted file mode 100755 index 3886f7ec5a2..00000000000 --- a/ext/pdo/tests/pdo_026.inc +++ /dev/null @@ -1,69 +0,0 @@ -dbh = $dbh; - echo __METHOD__ . "()\n"; - } - - function __destruct() - { - echo __METHOD__ . "()\n"; - } -} - -class PDODatabase extends PDO -{ - function __destruct() - { - echo __METHOD__ . "()\n"; - } - - function query($sql) - { - echo __METHOD__ . "()\n"; - $stmt = $this->prepare($sql, array(PDO_ATTR_STATEMENT_CLASS=>array('PDOStatementx', array($this)))); - $stmt->setFetchMode(PDO_FETCH_ASSOC); - $stmt->execute(); - return $stmt; - } -} - -$DB = new PDODatabase($CONNECTION, isset($USER) ? $USER : NULL, isset($PASSWD) ? $PASSWD : NULL); -var_dump(get_class($DB)); - -$DB->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING); - -$DB->exec($SQL['create1']); - -$stmt = $DB->prepare($SQL['insert1']); -var_dump(get_class($stmt)); -foreach ($data as $row) { - $stmt->execute($row); -} - -$stmt = $DB->query($SQL['select']); -var_dump(get_class($stmt)); -var_dump(get_class($stmt->dbh)); - -foreach($stmt as $obj) { - var_dump($obj); -} - -?>