New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testcase does not open, throws ' Cannot open file "mytest.php" ' #279
Comments
Are you in the directory containing the test case? Do you have a bootstrap.php file that sets up the include path appropriately? |
Are you using "tab" for complete the address to the file? if you are doing that stop doing it, write the address manually :) |
Seems more like a file permission or some other kind of error than a phpunit problem. As I've got no way of reproducing this I'll close it. Feel free to reopen if needed |
Disclaimer: Posting on this closed issue because is the closest I got of an issue like mine, and it might be useful to someone else... For anyone that may still be facing this issue, check if 'safe_mode = On' on /etc/php5/cli/php.ini. It would have saved me hours of hair pulling if I found out it earlier :/ |
Thx alfetopito! |
In case anybody fall here from a Google search, I had the same problem, but my file was |
i had the same problem, the its was a path issue, kindly check that you are pointing your bash terminal to the correct path. |
Ran through same issue, had not fixed path to the bootstrap.php on the phpunit.xml file... |
I had |
I have been trying to install PHPunit for 5days!. now its working and am having this error which might be the last I will have. I am geting "cannot open file filename.php" please help!! |
@pumamammal I would like to understand why it took you five days to install PHPUnit as I would like to improve the documentation accordingly. Can you please open a ticket at https://github.com/sebastianbergmann/phpunit-documentation/issues/new and explain where https://phpunit.de/getting-started.html and https://phpunit.de/manual/current/en/installation.html failed you? As for your |
I'm having the same error too after working through a few other nasty ones. I've been at this for 5 days nonstop as well. Safe mode is off, permissions are 777. I don't have a bootstrap.php file. Is that necessary? If so, is there any documentation on how to create one? I'm a novice developer. |
I'm getting same error too, but when I don't specify a file it run with no problem. |
I'm getting the same error too, and I try to solve it through the following steps
|
I solved the problem!! Thank you |
In my case, just adding '.php' at the end of the filename worked. I hope it helps. :D |
see: sebastianbergmann/phpunit#279 Somehow have the issue on local Solus but not on Travis.
if you use the full path it should be okay for example when I used unit --bootstrap "C:\xampp\htdocs\general-php\vendor\autoload.php" tests issue resolved |
I am still having this issue. I call php unit on the file with and without the ".php" extension. I reference the bootstrap.php file in my xml correctly and I also have tried referencing it explicitly with "--bootstrap". I can also run another test file in the same folder just fine. All of them actually except this one. They all have the same permissions. OrganizationTest.php is the problem file.
UPDATE: The test runs if I run it with all the others. I cannot run it alone though which adds approx. 5 min to each run while I'm trying to get these tests working. UPDATE-2: Quick workaround is the "--filter" flag. It allows you to run just one test out of the batch. e.g. |
Same for me. Simply adding the "--filter" flag worked. Otherwise it didn't. |
Hi,
I have installed PHPUnit 3.5.14 using the Pear package installation on my sandbox that runs CentOS 5.2
When I tried to execute my testcases located at the location:
using the terminal command:
This is throwing me the following error:
PHPUnit 3.5.14 by Sebastian Bergmann.
Cannot open file "mytest.php".
I have even tried to uninstall and reinstall phpunit, but then its still throwing the same error.
assertTrue(FALSE); } ``` /** * @Depends testOne */ public function testTwo() { } ``` } ?>The code inside mytest.php is as follows:
Any help would be highy appreciated.
Thanks for looking into my post.
Regards,
LoGiX
The text was updated successfully, but these errors were encountered: