2

I'm stuck with PHPUnit installation to CakePHP.

What I have:

  • Debian 6
  • CakePHP 2.4.6
  • PHPUnit 4.0.7

What I did:

  1. I installed PHPUnit via PEAR as recommened in CakePHP doc. It somehow installed the phar archive so that I'm able to use phpunit executable via CLI. CakePHP test.php is looking for PHPUnit/Autoload.php in PHP include_path. But no directory called PHPUnit was created anywhere.
  2. Then I tried apt-get with (a little bit) more success: PHPUnit directory with the source was created at /usr/share/php/PHPUnit. I searched the whole machine for Autoload.php, but there was none.

What am I doing wrong? Where is my Autoload.php?

3
  • See the tip here - that worked for me. Commented Mar 15, 2014 at 11:17
  • Brilliant, that worked, thank you @mark! The installation instructions are a little unclear though. You have to actually rename the folder you clone, not clone into a folder. If it helps somebody... Commented Mar 15, 2014 at 11:27
  • 1
    But the question remains: why don't the official solutions work? Commented Mar 15, 2014 at 11:50

1 Answer 1

2

Autoload.php no longer exists in the 4.x branch. I believe it was added in the 3.5 branch and remains through the 3.7 branch:

https://github.com/sebastianbergmann/phpunit/blob/3.7.37/PHPUnit/Autoload.php

If you want to downgrade, this should work:

pear uninstall phpunit/PHPUnit
pear channel-discover pear.symfony.com
pear install phpunit/PHPUnit-3.7.35
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.