6

I installed phpunit for my symfony2 project following this: How to use phpunit installed from composer?

But I get the following error now:

Warning: include(C:\Program Files (x86)\Zend\Apache2\Program Files (x86)\Zend\Apache2\htdocs\project1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php): failed to open stream: No such file or directory in C:\Program Files (x86)\Zend\Apache2\htdocs\project1\vendor\composer\ClassLoader.php on line 150

The file does exist and is in the autoload_classmap file, so I'm unsure why I receive this error when I run vendor/bin/phpunit -c app

Community
  • 1
  • 1
Tjorriemorrie
  • 16,818
  • 20
  • 89
  • 131

2 Answers2

3

You only should fix your basePath issue: instead of this:

C:\Program Files (x86)\Zend\Apache2\Program Files (x86)\Zend\Apache2\htdocs\project1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php

it should be this : C:\Program Files (x86)\Zend\Apache2\htdocs\project1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php

You should go and read in line 150 of composer\ClassLoader.php and if possible add some echo or var_dump to debug and see the content of the variables used there that point to a wrong path.

Mehdi Karamosly
  • 5,388
  • 2
  • 32
  • 50
  • That gives: `string(121) "C:\/www/project1/../../Program Files (x86)/Zend/Apache2/htdocs/proj ect1/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php"`. The problem was I used a symlink. As soon as I updated composer not in the symlink directory, it updated the $baseDir correctly, and I could run the tests. – Tjorriemorrie Dec 18 '12 at 08:23
2

Program Files (x86)\Zend\Apache2\

show up twice in the include error but not the open stream error.

open stream: No such file or directory in C:\Program Files (x86)\Zend\Apache2\htdocs\project1\vendor\composer\ClassLoader.php on line 150

topaz1008
  • 215
  • 3
  • 4