From 62fda26c4f75387f115a058424f7655ccdc76c95 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 18 Oct 2013 16:44:57 -0400 Subject: [PATCH 1/4] install phpunit & latest zend framework in composer --- composer.json | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 8e5a228..1de0a04 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "geometria-lab/rediska", "description": "Full-featured PHP client for key-value database Redis", + "keywords": ["redis", "zend", "sessions", "cache"], "authors": [ { "name": "Ivan Shumkov", @@ -19,22 +20,15 @@ "email": "till@php.net" } ], - "repositories": [ - { - "type": "package", - "package": { - "name": "zendframework/zendframework", - "version": "1.11.11", - "dist": { - "url": "http://packages.zendframework.com/releases/ZendFramework-1.11.11/ZendFramework-1.11.11-minimal.zip", - "type": "zip" - } - } - } - ], + "repositories" : [{ + "type" : "vcs", + "url" : "https://github.com/zendframework/zf1.git" + } + ], "require": {}, "require-dev": { - "zendframework/zendframework": "1.11.*" + "phpunit/phpunit" : ">=3.7.11", + "zendframework/zendframework1" : ">=1.12.1" }, "autoload": { "psr-0":{ From c09dbf81ac893a162a000dce2959d2530f914253 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 18 Oct 2013 16:45:13 -0400 Subject: [PATCH 2/4] added php 5.5 to travis settings and install composer packages with --prefer-source to avoid timeouts --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 091ea92..9104a1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,14 @@ language: php php: - 5.3 - 5.4 + - 5.5 -before_script: +before_install: - curl -s http://getcomposer.org/installer | php - - php composer.phar install --dev + - php composer.phar install --dev --no-interaction --prefer-source + - phpenv rehash script: - redis-server tests/redis.conf - redis-server tests/redis2.conf - - cd tests; phpunit \ No newline at end of file + - php vendor/bin/phpunit -c tests/phpunit.xml From 8e4693973acd7a9034e49f610ca81049b537661c Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 18 Oct 2013 16:45:36 -0400 Subject: [PATCH 3/4] avoid using arrays with array_unique() as arrays are converted into strings --- tests/library/Rediska/Command/DiffSetsTest.php | 2 +- tests/library/Rediska/Command/IntersectSetsTest.php | 2 +- tests/library/Rediska/Command/UnionSetsTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/library/Rediska/Command/DiffSetsTest.php b/tests/library/Rediska/Command/DiffSetsTest.php index 8fe922d..b9d1d0f 100644 --- a/tests/library/Rediska/Command/DiffSetsTest.php +++ b/tests/library/Rediska/Command/DiffSetsTest.php @@ -41,7 +41,7 @@ protected function _diffViaPhp() } protected $_sets = array( - 'set1' => array(1, 3, 6, 4, 2, 'fds', 312, array('1a', 1, 2)), + 'set1' => array(1, 3, 6, 4, 2, 'fds', 312, 'asdadaaa'), 'set2' => array(1, 5, 3, 7, 'aaa', 534), 'set3' => array('asdas', 1, 6, 3, 'y', 'aaa', 4) ); diff --git a/tests/library/Rediska/Command/IntersectSetsTest.php b/tests/library/Rediska/Command/IntersectSetsTest.php index c21824e..22261cc 100644 --- a/tests/library/Rediska/Command/IntersectSetsTest.php +++ b/tests/library/Rediska/Command/IntersectSetsTest.php @@ -48,7 +48,7 @@ protected function _intersectViaPhp() } protected $_sets = array( - 'set1' => array(1, 3, 6, 4, 2, 'fds', 312, array('1a', 1, 2)), + 'set1' => array(1, 3, 6, 4, 2, 'fds', 312, 'asdadaaa'), 'set2' => array(1, 5, 3, 7, 'aaa', 534), 'set3' => array('asdas', 1, 6, 3, 'y', 'aaa', 4) ); diff --git a/tests/library/Rediska/Command/UnionSetsTest.php b/tests/library/Rediska/Command/UnionSetsTest.php index ff303ac..a04731b 100644 --- a/tests/library/Rediska/Command/UnionSetsTest.php +++ b/tests/library/Rediska/Command/UnionSetsTest.php @@ -48,7 +48,7 @@ protected function _unionViaPhp() } protected $_sets = array( - 'set1' => array(1, 3, 6, 4, 2, 'fds', 312, array('1a', 1, 2)), + 'set1' => array(1, 3, 6, 4, 2, 'fds', 312, 'asdadaaa'), 'set2' => array(1, 5, 3, 7, 'aaa', 534), 'set3' => array('asdas', 1, 6, 3, 'y', 'aaa', 4) ); From 881765bb10a95fa72e46dc1887c2155409d3d6f3 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 18 Oct 2013 16:45:54 -0400 Subject: [PATCH 4/4] 1 second lifetime difference is acceptable for the cache touch test --- tests/library/Rediska/Zend/Cache/CacheTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/library/Rediska/Zend/Cache/CacheTest.php b/tests/library/Rediska/Zend/Cache/CacheTest.php index 18ec601..96e3626 100644 --- a/tests/library/Rediska/Zend/Cache/CacheTest.php +++ b/tests/library/Rediska/Zend/Cache/CacheTest.php @@ -130,8 +130,8 @@ public function testTouch() $this->assertTrue($reply); $meta = $this->cache->getMetadatas('test_id'); $lifetime = $meta['expire'] - time(); - $this->assertTrue($lifetime > 290); - $this->assertEquals(300, $lifetime); + $this->assertTrue($lifetime >= 299); + $this->assertTrue($lifetime <= 301); } /**