Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit d1c9d29

Browse files
committed
Merge pull request zendframework#482 from mhujer/471-phpunit-phar
Stop using PEAR version of PHPUnit. Use git cloning instead.
2 parents fbb3862 + b77da37 commit d1c9d29

File tree

3 files changed

+43
-14
lines changed

3 files changed

+43
-14
lines changed

tests/Zend/Filter/Compress/TarTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function setUp()
5555
if (!class_exists('Archive_Tar')) {
5656
require_once 'Zend/Loader.php';
5757
try {
58-
Zend_Loader::loadClass('Archive_Tar');
58+
@Zend_Loader::loadClass('Archive_Tar');
5959
} catch (Zend_Exception $e) {
6060
$this->markTestSkipped('This filter needs PEARs Archive_Tar');
6161
}

tests/php52_install_dependencies.sh

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,50 @@
11
#!/bin/sh
22

3-
# To install DbUnit, we have to install everything
4-
pear channel-discover pear.phpunit.de
5-
pear channel-discover pear.symfony-project.com
6-
pear update-channels
7-
83
# remove any existing phpunit packages
94
pear uninstall -n pear.phpunit.de/PHPUnit
105
pear uninstall -n pear.phpunit.de/PHP_CodeCoverage
116
pear uninstall -n pear.phpunit.de/PHPUnit_MockObject
127
pear uninstall -n pear.phpunit.de/File_Iterator
138
pear uninstall -n pear.phpunit.de/Text_Template
149
pear uninstall -n pear.phpunit.de/PHP_Timer
15-
pear uninstall -n pear.symfony-project.com/YAML
10+
11+
# Install PHPUnit from git (only possibility for PHPUnit 3.6)
12+
cd tests
13+
mkdir phpunit && cd phpunit
14+
git clone git://github.com/sebastianbergmann/phpunit.git
15+
git clone git://github.com/sebastianbergmann/dbunit.git
16+
git clone git://github.com/sebastianbergmann/php-file-iterator.git
17+
git clone git://github.com/sebastianbergmann/php-text-template.git
18+
git clone git://github.com/sebastianbergmann/php-code-coverage.git
19+
git clone git://github.com/sebastianbergmann/php-token-stream.git
20+
git clone git://github.com/sebastianbergmann/php-timer.git
21+
git clone git://github.com/sebastianbergmann/phpunit-mock-objects.git
22+
git clone git://github.com/sebastianbergmann/phpunit-selenium.git
23+
git clone git://github.com/sebastianbergmann/phpunit-story.git
24+
git clone git://github.com/sebastianbergmann/php-invoker.git
25+
26+
# last versions without anonymous functions
27+
cd dbunit && git checkout 1.1 && cd ..
28+
cd php-code-coverage && git checkout 1.1 && cd ..
29+
cd php-file-iterator && git checkout 1.3.2 && cd ..
30+
cd php-invoker && git checkout 1.1.1 && cd ..
31+
cd php-text-template && git checkout 1.1.2 && cd ..
32+
cd php-timer && git checkout 1.0.3 && cd ..
33+
cd php-token-stream && git checkout 1.1.4 && cd ..
34+
cd phpunit && git checkout 3.6.12 && cd ..
35+
cd phpunit-mock-objects && git checkout 1.1 && cd ..
36+
cd phpunit-selenium && git checkout 1.1 && cd ..
37+
cd phpunit-story && git checkout 1.0.0 && cd ..
38+
39+
sed -i 's/@package_version@/3.6.12/g' phpunit/PHPUnit/Runner/Version.php
40+
cat phpunit/PHPUnit/Runner/Version.php
41+
42+
cd phpunit
43+
44+
php -d include_path='.:../phpunit/:../dbunit/:../php-code-coverage/:../php-file-iterator/:../php-invoker/:../php-text-template/:../php-timer:../php-token-stream:../phpunit-mock-objects/:../phpunit-selenium/:../phpunit-story/:/usr/local/lib/php' ../phpunit/phpunit.php --version
45+
46+
cd ..
47+
cd ..
1648

1749
# memcache 2.1.0 is the last version to support the php 5.2 branch
1850
pecl download memcached-2.1.0
@@ -23,9 +55,3 @@ printf "\n" | phpize
2355

2456
printf "\n" | pecl uninstall memcache
2557
printf "\n" | pecl install memcache
26-
27-
# Install
28-
pear install -o pear.phpunit.de/PHPUnit
29-
pear install pear.phpunit.de/DbUnit
30-
31-

tests/runalltests.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
echo "PHPUnit is not executable ($PHPUNIT)";
4444
}
4545

46-
if ($_SERVER['TRAVIS_PHP_VERSION'] != '5.2') {
46+
if ($_SERVER['TRAVIS_PHP_VERSION'] == '5.2') {
47+
//PHPUnit from git clone
48+
$PHPUNIT = 'php -d include_path=\'.:./phpunit/phpunit/:./phpunit/dbunit/:./phpunit/php-code-coverage/:./phpunit/php-file-iterator/:./phpunit/php-invoker/:./phpunit/php-text-template/:./phpunit/php-timer:./phpunit/php-token-stream:./phpunit/phpunit-mock-objects/:./phpunit/phpunit-selenium/:./phpunit/phpunit-story/:/usr/local/lib/php\' ./phpunit/phpunit/phpunit.php';
49+
} else {
4750
$PHPUNIT = '../bin/phpunit'; //PHPUnit from composer
4851
}
4952

0 commit comments

Comments
 (0)