Skip to content

Instantly share code, notes, and snippets.

@haterecoil
Last active January 15, 2016 15:33
Show Gist options
  • Save haterecoil/3f64d1e5f454ccf9eeed to your computer and use it in GitHub Desktop.
Save haterecoil/3f64d1e5f454ccf9eeed to your computer and use it in GitHub Desktop.

#PHP Unit, the easy way

Phpunit a besoin de PHP V5.6 pour foncitonner. Sur Mac c'est PHP V5.5 ou truc du style. Ay ay ay caramba !

Donc on va :

  • installer Homebrew, un gestionnaire de paquet (un peu genre composer ou npm; mais plus exactement comme aptitude / apt-get )
  • installer php56 (aka PHP version 5.6) grâce à Homebrew
  • installer PhpUnit

Installer brew

Brew ça sert à installer des packages (des applications) via le terminal. C'est très pratique.

donc on écrit dans son terminal

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install wget

Au passage je vous fait installer wget, un équivalent de curl

installer php 5.6

et puis

brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php56

Installer phpunit

et enfin

wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
phpunit --version

ça va vous demander votre mot de passe

et si ça affiche des trucs qui ont l'air d'être des erreurs, GL HF :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment