Skip to content

Commit de5ad0f

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

File tree

5 files changed

+41
-9
lines changed

5 files changed

+41
-9
lines changed

tests/ibase_param_info_001.phpt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ print "---\n";
1616

1717
var_dump(ibase_param_info($rs, 100));
1818

19-
print "---\n";
20-
21-
var_dump(ibase_param_info(100));
22-
23-
2419
?>
2520
--EXPECTF--
2621
array(10) {
@@ -47,7 +42,3 @@ array(10) {
4742
}
4843
---
4944
bool(false)
50-
---
51-
52-
Warning: ibase_param_info() expects exactly 2 parameters, 1 given in %s on line %d
53-
NULL

tests/ibase_param_info_002.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
ibase_param_info(): Error if called with a single argument
3+
--SKIPIF--
4+
<?php
5+
include("skipif.inc");
6+
include("skipif-php8-or-newer.inc");
7+
?>
8+
--FILE--
9+
<?php
10+
11+
var_dump(ibase_param_info(100));
12+
13+
?>
14+
--EXPECTF--
15+
Warning: ibase_param_info() expects exactly 2 parameters, 1 given in %s on line %d
16+
NULL

tests/ibase_param_info_003.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
ibase_param_info(): Error if called with a single argument
3+
--SKIPIF--
4+
<?php
5+
include("skipif.inc");
6+
include("skipif-php7-or-older.inc");
7+
?>
8+
--FILE--
9+
<?php
10+
11+
var_dump(ibase_param_info(100));
12+
13+
?>
14+
--EXPECTF--
15+
Fatal error: Uncaught ArgumentCountError: ibase_param_info() expects exactly 2 arguments, 1 given in %a

tests/skipif-php7-or-older.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
if (PHP_MAJOR_VERSION < 8) {
3+
die('skip: This test verifies behavior that can only be observed in PHP versions >= 8.0');
4+
}
5+
?>

tests/skipif-php8-or-newer.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
if (PHP_MAJOR_VERSION >= 8) {
3+
die('skip: This test verifies behavior that can only be observed in PHP versions < 8.0');
4+
}
5+
?>

0 commit comments

Comments
 (0)