php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54411 PHP Unit fails with comment tags in strings
Submitted: 2011-03-28 18:24 UTC Modified: 2011-03-29 11:46 UTC
From: ninja9578 at yahoo dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.3.6 OS: Ubuntu x86
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ninja9578 at yahoo dot com
New email:
PHP Version: OS:

 

 [2011-03-28 18:24 UTC] ninja9578 at yahoo dot com
Description:
------------
If you have a string that contains the characters /* in PHPUnit, all the tests 
after it will be ignored because for some reason it thinks that it is a comment.  
A quick workaround is to add a block comment immediately after it.

public function testOne(){
   //make sure that the directory is currently empty
   foreach(glob('/tmp/ftp/*') as $fn) {
      unlink($fn);
   }
   /* */ //<- this line is a workaround
}

Test script:
---------------
public function testOne(){
   //make sure that the directory is currently empty
   foreach(glob('/tmp/ftp/*') as $fn) {
      unlink($fn);
   }
}

public function testTwo(){
   //This test case will not show up in the test list
}



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-29 11:46 UTC] aharvey@php.net
-Status: Open +Status: Bogus
 [2011-03-29 11:46 UTC] aharvey@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

My guess is that you have an unclosed string somewhere earlier in your script.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Aug 01 11:00:02 2025 UTC