Bug #70034 [Csd]: ReflectionClass->getFileName in PHPT returns "-" as filename
| From: | cmb@php.net | Date: | Thu, 09 Jul 2015 18:12:51 +0000 |
| Subject: | Bug #70034 [Csd]: ReflectionClass->getFileName in PHPT returns "-" as filename | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194264@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70034&edit=1
ID: 70034
Updated by: cmb@php.net
Reported by: james at asgrim dot com
Summary: ReflectionClass->getFileName in PHPT returns "-" as
filename
Status: Closed
Type: Bug
Package: Reflection related
Operating System: Ubuntu 15.04
PHP Version: 5.6.10
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Ah, interesting! I didn't know that PHPUnit is able to run phpt
tests.
Anyway, I gave it a try on Windows, and got the following:
--- Expected
+++ Actual
@@ @@
-string(%d) "%sReflectionClass_FileInfo_basic.php"
+string(43) "C:\Users\cmb\AppData\Local\Temp\PHP2C57.tmp"
So indeed, this seems to be a current limitation of PHPUnit.
Previous Comments:
------------------------------------------------------------------------
[2015-07-09 17:27:59] james at asgrim dot com
Hmm - I'm running the test using PHP Unit, so this may be a bug there instead. I'll close
this, investigate some more and re-open if it needs a closer look at here :)
Thank you!
------------------------------------------------------------------------
[2015-07-09 14:42:28] cmb@php.net
The test passes for me, and apparently for others as well[1]. How
did you run the test (make test or directly via run-tests.php)?
[1] <https://qa.php.net/reports/run_tests.php?version=5.6.10>
------------------------------------------------------------------------
[2015-07-09 12:53:28] james at asgrim dot com
Description:
------------
The ReflectionClass_FileInfo_basic.phpt test is failing.
When creating a reflection of a class in a .phpt test, the getFileName() method returns simply a
string with a hypen ("-") instead of the actual filename.
--- Expected
+++ Actual
@@ @@
-string(%d) "%sReflectionClass_FileInfo_basic.php"
+string(1) "-"
https://github.com/php/php-src/blob/master/ext/reflection/tests/ReflectionClass_FileInfo_basic.phpt
Expected result:
----------------
Expect the filename returned by getFileName() to be "%sReflectionClass_FileInfo_basic.php"
Actual result:
--------------
The filename returned by getFileName() is actually "-"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70034&edit=1