Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arjenroodselaar/1334531 to your computer and use it in GitHub Desktop.
Save arjenroodselaar/1334531 to your computer and use it in GitHub Desktop.
A script to compile PHPUnit-3.5.15 with all dependencies into archive which can be extracted to CakePHP 2.0 Vendor directory in order to UnitTest cake (if you don't have access to PEAR commands or PEAR insists on installing PHPUnit-3.6.0 and not working).
#!/bin/sh
# Creating temp dirs
mkdir .compile_PHPUnit_$$
cd .compile_PHPUnit_$$
# Fetching the archives
wget -nv http://pear.phpunit.de/get/PHPUnit-3.5.15.tgz
wget -nv http://pear.phpunit.de/get/DbUnit-1.0.0.tgz
wget -nv http://pear.phpunit.de/get/File_Iterator-1.2.3.tgz
wget -nv http://pear.phpunit.de/get/Text_Template-1.0.0.tgz
wget -nv http://pear.phpunit.de/get/PHP_CodeCoverage-1.0.2.tgz
wget -nv http://pear.phpunit.de/get/PHP_Timer-1.0.0.tgz
wget -nv http://pear.phpunit.de/get/PHPUnit_MockObject-1.0.3.tgz
wget -nv http://pear.phpunit.de/get/PHPUnit_Selenium-1.0.1.tgz
wget -nv http://pear.phpunit.de/get/PHP_TokenStream-1.1.0.tgz
wget -nv http://pear.symfony-project.com/get/YAML-1.0.2.tgz
wget -nv http://download.pear.php.net/package/XML_RPC2-1.1.1.tgz
# Unpacking
tar -xzf PHPUnit-3.5.15.tgz && echo "Unpacked PHPUnit 3.5.15"
tar -xzf DbUnit-1.0.0.tgz && echo "Unpacked DbUnit 1.0.0"
tar -xzf File_Iterator-1.2.3.tgz && echo "Unpacked File_Iterator 1.2.3"
tar -xzf Text_Template-1.0.0.tgz && echo "Unpacked Text_Template 1.0.0"
tar -xzf PHP_CodeCoverage-1.0.2.tgz && echo "Unpacked PHP_CodeCoverage 1.0.2"
tar -xzf PHP_Timer-1.0.0.tgz && echo "Unpacked PHP_Timer 1.0.0"
tar -xzf PHPUnit_MockObject-1.0.3.tgz && echo "Unpacked PHPUnit_MockObject 1.0.3"
tar -xzf PHPUnit_Selenium-1.0.1.tgz && echo "Unpacked PHPUnit_Selenium 1.0.1"
tar -xzf PHP_TokenStream-1.1.0.tgz && echo "Unpacked PHP_TokenStream 1.1.0"
tar -xzf YAML-1.0.2.tgz && echo "Unpacked YAML 1.0.2"
tar -xzf XML_RPC2-1.1.1.tgz && echo "Unpacked XML_RPC2 1.1.1"
# Creating target dir
mkdir Vendor
# Copying everything to Vendor
cp -r PHPUnit-3.5.15/PHPUnit Vendor/
cp -r DbUnit-1.0.0/PHPUnit Vendor/
cp -r PHPUnit_MockObject-1.0.3/PHPUnit Vendor/
cp -r PHPUnit_Selenium-1.0.1/PHPUnit Vendor/
cp -r File_Iterator-1.2.3/File Vendor/
cp -r PHP_CodeCoverage-1.0.2/PHP Vendor/
cp -r PHP_Timer-1.0.0/PHP Vendor/
cp -r Text_Template-1.0.0/Text Vendor/
cp -r YAML-1.0.2/lib Vendor/
cp -r XML_RPC2-1.1.1/XML Vendor/
cp -r PHP_TokenStream-1.1.0/PHP Vendor/
# Creating a package
cd Vendor
tar -czf ../../PHPUnit_for_Vendor.tar.gz *
cd ..
# Cleaning up
cd ..
rm -rf .compile_PHPUnit_$$
echo
echo "Done. Extract the files from `pwd`/PHPUnit_for_Vendor.tar.gz to your Vendor directory."
@arjenroodselaar
Copy link
Author

Added the PHP_TokenStream dependency.

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