mirror of
https://github.com/php/php-src.git
synced 2024-09-29 05:46:06 +00:00
dea7bc8786
Adds tests for SplFileInfo class setters accepting either the base and child classes, and throwing an exception for unexpected classes. Related: http://svn.php.net/viewvc?view=revision&revision=336017 and https://github.com/facebook/hhvm/pull/4917
17 lines
369 B
PHP
17 lines
369 B
PHP
--TEST--
|
|
SplFileInfo::setFileClass() throws exception for invalid class
|
|
--FILE--
|
|
<?php
|
|
|
|
$info = new SplFileInfo(__FILE__);
|
|
|
|
try {
|
|
$info->setFileClass('stdClass');
|
|
} catch (UnexpectedValueException $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
SplFileInfo::setFileClass() expects parameter 1 to be a class name derived from SplFileObject, 'stdClass' given
|