Skip to content

Commit 6eef9bf

Browse files
committed
Add test for parser MINFO_FUNCTION
1 parent fb12b7a commit 6eef9bf

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/base/extension_info.phpt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
--TEST--
2+
Test extension info
3+
--SKIPIF--
4+
<?php include(__DIR__ . '/../skipif.inc'); ?>
5+
--FILE--
6+
<?php
7+
8+
function contains($input, $expected) {
9+
return strpos($input, $expected) !== false
10+
? $expected
11+
: 'not contains';
12+
}
13+
14+
$version = phpversion('Zephir Parser');
15+
$actual = trim(file_get_contents(__DIR__ . '/../../VERSION'));
16+
17+
$compare = $version === $actual;
18+
var_dump($compare);
19+
20+
ob_start();
21+
phpinfo(INFO_MODULES);
22+
$info = trim(ob_get_clean());
23+
24+
echo contains($info, 'Zephir Parser').PHP_EOL;
25+
echo contains($info, 'The Zephir Parser delivered as a C extension for the PHP language.').PHP_EOL;
26+
echo contains($info, 'Zephir Parser => enabled').PHP_EOL;
27+
echo contains($info, 'Author => Zephir Team and contributors').PHP_EOL;
28+
echo contains($info, 'Version =>').PHP_EOL;
29+
echo contains($info, 'Build Date =>').PHP_EOL;
30+
?>
31+
--EXPECT--
32+
bool(true)
33+
Zephir Parser
34+
The Zephir Parser delivered as a C extension for the PHP language.
35+
Zephir Parser => enabled
36+
Author => Zephir Team and contributors
37+
Version =>
38+
Build Date =>

0 commit comments

Comments
 (0)