Skip to content

Commit b56bdff

Browse files
committed
Split tests/ibase_close_001.phpt into 3 tests
This patch splits `tests/ibase_close_001.phpt` into 3 tests so that we can check for different error messages depending on which PHP version we are running.
1 parent 9218922 commit b56bdff

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

tests/ibase_close_001.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ $x = ibase_connect($test_base);
1111
var_dump(ibase_close($x));
1212
var_dump(ibase_close($x));
1313
var_dump(ibase_close());
14-
var_dump(ibase_close('foo'));
1514

1615
?>
1716
--EXPECTF--
1817
bool(true)
1918
bool(true)
2019
bool(true)
21-
22-
Warning: ibase_close() expects parameter 1 to be resource, string given in %s on line %d
23-
NULL

tests/ibase_close_002.phpt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
ibase_close(): Make sure passing a string to the function emits a warning
3+
--SKIPIF--
4+
<?php
5+
include("skipif.inc");
6+
include("skipif-php8-or-newer.inc");
7+
?>
8+
--FILE--
9+
<?php
10+
11+
require("interbase.inc");
12+
13+
$x = ibase_connect($test_base);
14+
var_dump(ibase_close($x));
15+
var_dump(ibase_close($x));
16+
var_dump(ibase_close());
17+
var_dump(ibase_close('foo'));
18+
19+
?>
20+
--EXPECTF--
21+
bool(true)
22+
bool(true)
23+
bool(true)
24+
25+
Warning: ibase_close() expects parameter 1 to be resource, string given in %s on line %d
26+
NULL

tests/ibase_close_003.phpt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
ibase_close(): Make sure passing a string to the function throws an error.
3+
--SKIPIF--
4+
<?php
5+
include("skipif.inc");
6+
include("skipif-php7-or-older.inc");
7+
?>
8+
--FILE--
9+
<?php
10+
11+
require("interbase.inc");
12+
13+
$x = ibase_connect($test_base);
14+
var_dump(ibase_close($x));
15+
var_dump(ibase_close($x));
16+
var_dump(ibase_close());
17+
var_dump(ibase_close('foo'));
18+
19+
?>
20+
--EXPECTF--
21+
bool(true)
22+
bool(true)
23+
bool(true)
24+
25+
Fatal error: Uncaught TypeError: ibase_close(): Argument #1 ($link_identifier) must be of type resource, string given in %a

0 commit comments

Comments
 (0)