Reputation: 2295
I am trying to install PHPUnit on a shared hosting server i.e. GoDaddy. In the cpanel provided by GoDaddy, i can see PHP Pear extensions, which on searching gave me only phpunit1, phpunit2 which are very old versions, given we have phpunit 4.6 now.
The documentation here https://phpunit.de/manual/3.7/en/installation.html#installation.phar says to use
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
When i sshed into my shared hosting, and did a wget it gave me permission denied.
I was wondering if there is a way for godaddy shared hosting to have phpunit4.6 using cpanel. If not, can i simply download phpunit inside an existing framework and start referring to phpunit framework to write my test cases ?
Upvotes: 1
Views: 1079
Reputation: 5256
Found this while searching for how do I install PHPUnit for CakePHP 2 on a GoDaddy account.
PHPUnit
folder from the acrchive and place it under /lib
, the one next to the /app
folder, not inside of it. CakePHP will automatically add this to the include_path
and pick up the PHPUnit's Autoloader.php
.
Now, the question wasn't about the CakePHP specifically. In that case, just make sure the PHPUnit is in your include path (you can read it by running php -i | grep include_path
from your command line, or just calling phpinfo()
)
Upvotes: 0
Reputation: 3967
What you are trying to do is to install PHPUnit globally. I have never used GoDaddy, but I can assume, since it is a shared hosting, you will.never be allowed to move the phpunit.phar to bin folder.
Try to leave it in your local folder. That should work without any issues.
You can also use composer to install it. Take a look at the official documentation here: https://phpunit.de/manual/current/en/installation.html
Upvotes: 1