Skip to content
This repository was archived by the owner on May 16, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,22 @@ php:
env: TMPDIR=/tmp

install:
- sh ./tests/install_dependencies.sh
- if [[ "$TRAVIS_PHP_VERSION" == "5.2" ]]; then sh ./tests/php52_install_dependencies.sh; fi
- phpenv rehash

services:
- memcached

before_script:
- if [[ "$TRAVIS_PHP_VERSION" != "5.2" ]]; then travis_retry composer self-update; fi
- if [[ "$TRAVIS_PHP_VERSION" != "5.2" ]]; then travis_retry composer install --no-interaction --prefer-source --dev; fi

- mysql -e 'create database zftest;'
- psql -c 'create database zftest;' -U postgres
- echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

- if [[ "$TRAVIS_PHP_VERSION" != "5.2" ]]; then phpenv config-add tests/config.ini; fi
- if [[ "$TRAVIS_PHP_VERSION" == "5.2" ]]; then phpenv config-add tests/php52_config.ini; fi

- cp ./tests/TestConfiguration.travis.php ./tests/TestConfiguration.php

script:
Expand Down
5 changes: 5 additions & 0 deletions tests/Zend/Cache/LibmemcachedBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public function __construct($name = null, array $data = array(), $dataName = '')

public function setUp($notag = true)
{
if(!class_exists('Memcached')) {
$this->markTestSkipped('Memcached is not installed, skipping test');
return;
}

$serverValid = array(
'host' => TESTS_ZEND_CACHE_LIBMEMCACHED_HOST,
'port' => TESTS_ZEND_CACHE_LIBMEMCACHED_PORT,
Expand Down
5 changes: 5 additions & 0 deletions tests/Zend/Cache/MemcachedBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public function __construct($name = null, array $data = array(), $dataName = '')

public function setUp($notag = true)
{
if(!class_exists('Memcached')) {
$this->markTestSkipped('Memcached is not installed, skipping test');
return;
}

$serverValid = array(
'host' => TESTS_ZEND_CACHE_MEMCACHED_HOST,
'port' => TESTS_ZEND_CACHE_MEMCACHED_PORT,
Expand Down
2 changes: 2 additions & 0 deletions tests/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extension = memcache.so
extension = memcached.so
27 changes: 0 additions & 27 deletions tests/install_dependencies.sh

This file was deleted.

1 change: 1 addition & 0 deletions tests/php52_config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension = memcached.so
31 changes: 31 additions & 0 deletions tests/php52_install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

# To install DbUnit, we have to install everything
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com
pear update-channels

# remove any existing phpunit packages
pear uninstall -n pear.phpunit.de/PHPUnit
pear uninstall -n pear.phpunit.de/PHP_CodeCoverage
pear uninstall -n pear.phpunit.de/PHPUnit_MockObject
pear uninstall -n pear.phpunit.de/File_Iterator
pear uninstall -n pear.phpunit.de/Text_Template
pear uninstall -n pear.phpunit.de/PHP_Timer
pear uninstall -n pear.symfony-project.com/YAML

# memcache 2.1.0 is the last version to support the php 5.2 branch
pecl download memcached-2.1.0
tar zxvf memcached*.tgz && cd memcached*
make clean
printf "\n" | phpize
./configure --with-libmemcached-dir=/usr/local && make && make install

printf "\n" | pecl uninstall memcache
printf "\n" | pecl install memcache

# Install
pear install -o pear.phpunit.de/PHPUnit
pear install pear.phpunit.de/DbUnit