Skip to content

Commit b2346e1

Browse files
committed
add test
1 parent 5f435f4 commit b2346e1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

ext/posix/tests/posix_mknodat.phpt renamed to ext/posix/tests/posix_mknodat_mkfifoat.phpt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
posix_mknodat support
2+
posix_mknodat/posix_mkfifoat support
33
--EXTENSIONS--
44
posix
55
--SKIPIF--
@@ -10,11 +10,18 @@ if (!function_exists('posix_mknodat')) die('skip posix_mknodat() not found');
1010
<?php
1111

1212
$fd = fopen(__DIR__, "r");
13-
var_dump(posix_mknodat($fd, 'dev', POSIX_S_IFBLK | 0777, 1, 0));
13+
var_dump(posix_mknodat($fd, '', POSIX_S_IFBLK | 0777, 1, 0));
1414
var_dump(posix_mknodat($fd, __DIR__ . '/dev', POSIX_S_IFBLK | 0777, 1, 0));
1515
try {
1616
posix_mknodat($fd, __DIR__ . '/dev', POSIX_S_IFBLK | 0777, 0, 0);
1717
} catch (\ValueError $e) {
18+
echo $e->getMessage() . PHP_EOL;
19+
}
20+
var_dump(posix_mkfifoat($fd, '', POSIX_S_IFBLK | 0777));
21+
var_dump(posix_mkfifoat($fd, __DIR__ . '/dev', POSIX_S_IFBLK | 0777));
22+
try {
23+
posix_mkfifoat(new stdClass(), 'dev', POSIX_S_IFBLK | 0777);
24+
} catch (TypeError $e) {
1825
echo $e->getMessage();
1926
}
2027
fclose($fd);
@@ -23,3 +30,6 @@ fclose($fd);
2330
bool(false)
2431
bool(false)
2532
posix_mknodat(): Argument #4 ($major) cannot be 0 for the POSIX_S_IFCHR and POSIX_S_IFBLK modes
33+
bool(false)
34+
bool(false)
35+
posix_mkfifoat(): Argument #1 ($file_descriptor) must be of type int|resource, stdClass given

0 commit comments

Comments
 (0)