Skip to content

Commit 0d11a76

Browse files
authored
Upgrades (#821)
* upgrade elastic to 5.6.3, remove hhvm testing, add sf 3.3 adn 3.4 * Add compatibility with Symfony 3.4 for DataCollectorInterface
1 parent 96a3c97 commit 0d11a76

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ php:
44
- 5.6
55
- 7.0
66
- 7.1
7-
- hhvm
87
env:
98
global:
109
- JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre"
11-
- ES_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.2.zip"
10+
- ES_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.3.zip"
1211
matrix:
1312
- SYMFONY="~2.8"
1413
- SYMFONY="~3.0"
1514
- SYMFONY="~3.1"
1615
- SYMFONY="~3.2"
17-
matrix:
18-
allow_failures:
19-
- php: hhvm
16+
- SYMFONY="~3.3"
17+
- SYMFONY="~3.4"
2018
addons:
2119
apt:
2220
packages:

Profiler/ElasticsearchProfiler.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ public function collect(Request $request, Response $response, \Exception $except
7575
}
7676
}
7777

78+
/**
79+
* {@inheritdoc}
80+
*/
81+
public function reset()
82+
{
83+
$this->queries = [];
84+
$this->count = 0;
85+
$this->time = 0;
86+
}
87+
7888
/**
7989
* Returns total time queries took.
8090
*

Service/Manager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,9 @@ public function dropIndex()
523523
public function dropAndCreateIndex($noMapping = false)
524524
{
525525
try {
526-
$this->dropIndex();
526+
if ($this->indexExists()) {
527+
$this->dropIndex();
528+
}
527529
} catch (\Exception $e) {
528530
// Do nothing, our target is to create new index.
529531
}

Tests/Functional/Service/RepositoryTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,14 @@ public function testCountApiRawResponse()
479479
'failed' => 0,
480480
];
481481

482-
$this->assertEquals($shards, $count['_shards']);
482+
$this->assertEquals($shards['total'], $count['_shards']['total']);
483+
$this->assertEquals($shards['successful'], $count['_shards']['successful']);
484+
$this->assertEquals($shards['failed'], $count['_shards']['failed']);
485+
486+
#TODO remove if statement after bundle drops sf 3.0 support
487+
if (isset($count['_shards']['skipped'])) {
488+
$this->assertEquals(0, $count['_shards']['skipped']);
489+
}
483490
}
484491

485492
/**

0 commit comments

Comments
 (0)