mirror of
https://github.com/php/php-src.git
synced 2025-01-25 05:04:20 +08:00
Test ReflectionZendExtension class
This commit is contained in:
parent
1cb3c15032
commit
9d139b16c2
23
ext/reflection/tests/ReflectionZendExtension.phpt
Normal file
23
ext/reflection/tests/ReflectionZendExtension.phpt
Normal file
@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Test ReflectionZendExtension class
|
||||
--CREDITS--
|
||||
Gabriel Caruso (carusogabriel34@gmail.com)
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded('Zend OPcache')) die('skip Zend OPcache extension not loaded'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$reflection = new ReflectionZendExtension('Zend OPcache');
|
||||
var_dump($reflection->getAuthor());
|
||||
var_dump($reflection->getCopyright());
|
||||
var_dump($reflection->getName());
|
||||
var_dump($reflection->getURL());
|
||||
var_dump($reflection->getVersion() === PHP_VERSION);
|
||||
var_dump(gettype($reflection->export('Zend OPcache', true)) === 'string');
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(17) "Zend Technologies"
|
||||
string(23) "Copyright (c) 1999-20%d"
|
||||
string(12) "Zend OPcache"
|
||||
string(20) "http://www.zend.com/"
|
||||
bool(true)
|
||||
bool(true)
|
17
ext/reflection/tests/ReflectionZendExtension_error.phpt
Normal file
17
ext/reflection/tests/ReflectionZendExtension_error.phpt
Normal file
@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Test ReflectionZendExtension class erros
|
||||
--CREDITS--
|
||||
Gabriel Caruso (carusogabriel34@gmail.com)
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded('Zend OPcache')) die('skip Zend OPcache extension not loaded'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
new ReflectionZendExtension('zend_opcache');
|
||||
} catch (ReflectionException $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Zend Extension zend_opcache does not exist
|
Loading…
Reference in New Issue
Block a user