Skip to content

Commit 46f970b

Browse files
committed
Add more test coverage for ext/odbc
1 parent 7273349 commit 46f970b

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
--TEST--
2+
odbc_close_all(): Basic test
3+
--EXTENSIONS--
4+
odbc
5+
--SKIPIF--
6+
<?php include 'skipif.inc'; ?>
7+
--FILE--
8+
<?php
9+
10+
include 'config.inc';
11+
12+
$conn1 = odbc_connect($dsn, $user, $pass);
13+
$conn2 = odbc_pconnect($dsn, $user, $pass);
14+
$result1 = odbc_columns($conn1, '', '', '', '');
15+
$result2 = odbc_columns($conn2, '', '', '', '');
16+
17+
var_dump($conn1);
18+
var_dump($conn2);
19+
var_dump($result1);
20+
var_dump($result2);
21+
22+
odbc_close_all();
23+
24+
var_dump($conn1);
25+
var_dump($conn2);
26+
var_dump($result1);
27+
var_dump($result2);
28+
29+
?>
30+
--EXPECTF--
31+
resource(5) of type (odbc link)
32+
resource(7) of type (odbc link persistent)
33+
resource(8) of type (odbc result)
34+
resource(9) of type (odbc result)
35+
resource(5) of type (Unknown)
36+
resource(7) of type (Unknown)
37+
resource(8) of type (Unknown)
38+
resource(9) of type (Unknown)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
Test odbc_longreadlen
3+
--EXTENSIONS--
4+
odbc
5+
--SKIPIF--
6+
<?php include 'skipif.inc'; ?>
7+
--FILE--
8+
<?php
9+
include 'config.inc';
10+
11+
$conn = odbc_connect($dsn, $user, $pass);
12+
13+
odbc_exec($conn, "CREATE TABLE longreadlen (id INT, whatever VARBINARY(50))");
14+
odbc_exec($conn, "INSERT INTO longreadlen VALUES (1, CONVERT(VARBINARY(50), 'whatever'))");
15+
16+
$res = odbc_exec($conn, "SELECT * FROM longreadlen");
17+
odbc_longreadlen($res, 4);
18+
odbc_fetch_row($res);
19+
var_dump(odbc_result($res, 'whatever'));
20+
?>
21+
--CLEAN--
22+
<?php
23+
include 'config.inc';
24+
25+
$conn = odbc_connect($dsn, $user, $pass);
26+
odbc_exec($conn, "DROP TABLE longreadlen");
27+
?>
28+
--EXPECT--
29+
string(4) "what"

0 commit comments

Comments
 (0)