summaryrefslogtreecommitdiff
path: root/ext/sqlite3/tests/sqlite3_openblob_wrongparams.phpt
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-03-08 09:45:24 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-03-08 13:46:39 +0100
commit59dd1979ef8edc2586b551b0686f57ddfa159160 (patch)
treea49b05c019b65dec9db582a4fb0cbd39ca390f34 /ext/sqlite3/tests/sqlite3_openblob_wrongparams.phpt
parentaa33ab96963c1a2dd55f209ab284172f85fd3980 (diff)
downloadphp-git-59dd1979ef8edc2586b551b0686f57ddfa159160.tar.gz
More zpp error/variation test removals
Diffstat (limited to 'ext/sqlite3/tests/sqlite3_openblob_wrongparams.phpt')
-rw-r--r--ext/sqlite3/tests/sqlite3_openblob_wrongparams.phpt79
1 files changed, 0 insertions, 79 deletions
diff --git a/ext/sqlite3/tests/sqlite3_openblob_wrongparams.phpt b/ext/sqlite3/tests/sqlite3_openblob_wrongparams.phpt
deleted file mode 100644
index 03242d935b..0000000000
--- a/ext/sqlite3/tests/sqlite3_openblob_wrongparams.phpt
+++ /dev/null
@@ -1,79 +0,0 @@
---TEST--
-SQLite3::blobOpen test, testing stream with wrong parameter count
---CREDITS--
-Michelangelo van Dam
-# Belgian PHP Testfest 2009
---SKIPIF--
-<?php require_once(__DIR__ . '/skipif.inc'); ?>
---FILE--
-<?php
-class SQLite3_Test_Stream
-{
- private $position;
- public static $string_length = 10;
- public static $string = "abcdefg\0hi";
-
- public function stream_open($path, $mode, $options, &$opened_path)
- {
- $this->position = 0;
- return true;
- }
-
- public function stream_read($count)
- {
- $ret = substr(self::$string, $this->position, $count);
- $this->position += strlen($ret);
- return $ret;
- }
-
- public function stream_write($data)
- {
- return 0;
- }
-
- public function stream_stat()
- {
- return array('size' => self::$string_length);
- }
-
- public function stream_tell()
- {
- return $this->position;
- }
-
- public function stream_eof()
- {
- return ($this->position >= self::$string_length);
- }
-}
-
-$db = new SQLite3(':memory:');
-stream_wrapper_register('sqliteBlobTest', "SQLite3_Test_Stream") or die("Unable to register sqliteBlobTest stream");
-echo "Creating table: " . var_export($db->exec('CREATE TABLE test (id STRING, data BLOB)'),true) . "\n";
-
-echo "PREPARING insert\n";
-$insert_stmt = $db->prepare("INSERT INTO test (id, data) VALUES (?, ?)");
-
-echo "BINDING Parameters:\n";
-var_dump($insert_stmt->bindValue(1, 'a', SQLITE3_TEXT));
-var_dump($insert_stmt->bindValue(2, 'TEST TEST', SQLITE3_BLOB));
-$insert_stmt->execute();
-echo "Closing statement: " . var_export($insert_stmt->close(), true) . "\n";
-
-echo "Open BLOB with wrong parameter count\n";
-$stream = $db->openBlob();
-var_dump($stream);
-echo "Done\n";
-?>
---EXPECTF--
-Creating table: true
-PREPARING insert
-BINDING Parameters:
-bool(true)
-bool(true)
-Closing statement: true
-Open BLOB with wrong parameter count
-
-Warning: SQLite3::openBlob() expects at least 3 parameters, 0 given in %s on line %d
-NULL
-Done