Skip to content

Instantly share code, notes, and snippets.

@sasezaki
Created December 9, 2011 12:50
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sasezaki/1451405 to your computer and use it in GitHub Desktop.
Save sasezaki/1451405 to your computer and use it in GitHub Desktop.
Use old PHPUnit (3.4 & 3.5) by installed via pyrus
#!/bin/sh
PYRUS=/path/to/pyrus.phar
php $PYRUS . set bin_dir ./bin
pear download components.ez.no/Base
pear download components.ez.no/ConsoleTools
php $PYRUS . channel-discover pear.phpunit.de
php $PYRUS . channel-discover components.ez.no
php $PYRUS . channel-discover pear.symfony-project.com
php $PYRUS . install Base-1.8.tgz
php $PYRUS . install ConsoleTools-1.6.1.tgz
rm Base-1.8.tgz
rm ConsoleTools-1.6.1.tgz
php $PYRUS . install phpunit/File_Iterator-1.2.6
php $PYRUS . install phpunit/PHP_TokenStream-1.0.1
php $PYRUS . install phpunit/PHP_CodeCoverage-1.0.5
php $PYRUS . install phpunit/PHP_Timer
php $PYRUS . install phpunit/PHPUnit-3.4.15
#!/bin/sh
PYRUS=/path/to/pyrus.phar
php $PYRUS . set bin_dir ./bin
pear download components.ez.no/Base
pear download components.ez.no/ConsoleTools
php $PYRUS . channel-discover pear.phpunit.de
php $PYRUS . channel-discover components.ez.no
php $PYRUS . channel-discover pear.symfony-project.com
php $PYRUS . install Base-1.8.tgz
php $PYRUS . install ConsoleTools-1.6.1.tgz
rm Base-1.8.tgz
rm ConsoleTools-1.6.1.tgz
php $PYRUS . install phpunit/File_Iterator-1.2.6
php $PYRUS . install phpunit/PHPUnit_MockObject-1.0.9
php $PYRUS . install phpunit/PHPUnit_Selenium-1.0.3
php $PYRUS . install phpunit/PHP_TokenStream-1.0.1
php $PYRUS . install phpunit/PHP_Timer
php $PYRUS . install phpunit/PHP_CodeCoverage-1.0.5
php $PYRUS . install phpunit/DbUnit-1.0.3
php $PYRUS . install phpunit/PHPUnit-3.5.15

#edit your ./bin/phpunit

##PHPUnit3.4

set_include_path(dirname(__DIR__).'/php' . PATH_SEPARATOR . get_include_path());
/*
if (strpos('/usr/bin/php', '@php_bin') === 0) {
    set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
}*/

##PHPUnit3.5

set_include_path(dirname(__DIR__).'/php' . PATH_SEPARATOR . get_include_path());

require_once 'PHP/CodeCoverage/Filter.php';
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'PHPUNIT');

/**
if (strpos('/usr/bin/php', '@php_bin') === 0) {
    set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
}*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment