Skip to content

Commit 3467c19

Browse files
committed
[TEST] Allow JSON workaround, remove travis hackery
1 parent f2ae26b commit 3467c19

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ matrix:
2525
include:
2626
- php: 7.1
2727
env: ES_VERSION="5.0" TEST_BUILD_REF="origin/5.0"
28+
- php: 7.1
29+
env: ES_VERSION="5.1" TEST_BUILD_REF="origin/5.1"
30+
- php: 7.1
31+
env: ES_VERSION="5.2" TEST_BUILD_REF="origin/5.2"
2832
allow_failures:
2933
- php: hhvm
3034

@@ -36,7 +40,6 @@ env:
3640
- JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre"
3741

3842
before_install:
39-
- if [ $TRAVIS_PHP_VERSION = '5.6' ]; then pecl uninstall json && pecl install json-1.3.7; fi
4043
- sudo update-java-alternatives -s java-8-oracle
4144
- ./travis/download_and_run_es.sh
4245

tests/Elasticsearch/Tests/YamlRunnerTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ public static function setUpBeforeClass()
103103
public function setUp()
104104
{
105105
$this->clean();
106-
$this->client = Elasticsearch\ClientBuilder::create()->setHosts([self::getHost()])->build();
106+
$builder = Elasticsearch\ClientBuilder::create()->setHosts([self::getHost()]);
107+
if (version_compare(phpversion(), '5.6.6', '<') || ! defined('JSON_PRESERVE_ZERO_FRACTION')) {
108+
$builder->allowBadJSONSerialization();
109+
}
110+
$this->client = $builder->build();
107111
}
108112

109113
/**

0 commit comments

Comments
 (0)