From c8f16412bd7aa064b22d99827f9c08aabbd258da Mon Sep 17 00:00:00 2001 From: Spamer Date: Thu, 18 Dec 2025 14:19:09 +0100 Subject: [PATCH 01/10] ci trigger --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0d5a03a..addd582 100644 --- a/composer.json +++ b/composer.json @@ -38,6 +38,6 @@ } }, "brach-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.0.0" } } From 852e9391e89166d1ac6934a922bffaa820bf6c18 Mon Sep 17 00:00:00 2001 From: Spamer Date: Thu, 18 Dec 2025 15:04:37 +0100 Subject: [PATCH 02/10] added docker for locally running tests --- .dockerignore | 5 ++++ .github/workflows/ci.yml | 2 ++ Dockerfile | 12 +++++++++ docker-compose.yml | 25 +++++++++++++++++++ .../Settings/Mapping/FieldSeparator.php | 4 +-- src/Response/Result/Version.php | 2 ++ .../Aggregation/AggregationCollection.phpt | 6 ++--- .../ElasticQuery/Aggregation/Avg.phpt | 6 ++--- .../ElasticQuery/Aggregation/Filter.phpt | 6 ++--- .../ElasticQuery/Aggregation/Histogram.phpt | 6 ++--- .../LeafAggregationCollection.phpt | 6 ++--- .../ElasticQuery/Aggregation/Max.phpt | 6 ++--- .../ElasticQuery/Aggregation/Min.phpt | 6 ++--- .../ElasticQuery/Aggregation/Nested.phpt | 6 ++--- .../ElasticQuery/Aggregation/Range.phpt | 6 ++--- .../ElasticQuery/Aggregation/Term.phpt | 6 ++--- .../ElasticQuery/Aggregation/TopHits.phpt | 6 ++--- .../ElasticQuery/ElasticQuery.phpt | 8 +++--- .../ElasticQuery/ElasticsearchTestCase.php | 21 ++++++++++++++++ .../Analyzer/Custom/CzechDictionary.phpt | 8 +++--- .../ElasticQuery/Query/ElasticMatch.phpt | 6 ++--- .../ElasticQuery/Query/Exists.phpt | 6 ++--- .../ElasticQuery/Query/Fuzzy.phpt | 6 ++--- .../ElasticQuery/Query/MatchPhrase.phpt | 6 ++--- .../ElasticQuery/Query/MultiMatch.phpt | 6 ++--- .../ElasticQuery/Query/Nested.phpt | 4 +-- .../ElasticQuery/Query/PhrasePrefix.phpt | 6 ++--- .../ElasticQuery/Query/Range.phpt | 6 ++--- .../SpameriTests/ElasticQuery/Query/Term.phpt | 6 ++--- .../ElasticQuery/Query/Terms.phpt | 6 ++--- .../ElasticQuery/Query/WildCard.phpt | 6 ++--- .../ElasticQuery/Response/ResultVersion.phpt | 22 +++++++++++++--- .../ElasticQuery/VersionCheck.php | 2 +- tests/SpameriTests/bootstrap.php | 2 ++ 34 files changed, 164 insertions(+), 79 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 tests/SpameriTests/ElasticQuery/ElasticsearchTestCase.php diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..0ca66da --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +vendor/ +.git/ +.phpcs-cache +.idea/ +*.log diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea5a247..29c7847 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,3 +43,5 @@ jobs: - name: Tests run: make tests + env: + ELASTICSEARCH_HOST: localhost:9200 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e6cb6b0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM php:8.2-cli + +RUN apt-get update && apt-get install -y \ + git \ + unzip \ + libcurl4-openssl-dev \ + && docker-php-ext-install curl \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +WORKDIR /app diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1479dbb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +services: + php: + build: . + volumes: + - .:/app + environment: + - ELASTICSEARCH_HOST=elasticsearch:9200 + depends_on: + elasticsearch: + condition: service_healthy + + elasticsearch: + image: elasticsearch:9.2.2 + environment: + - discovery.type=single-node + - xpack.security.enabled=false + - xpack.security.enrollment.enabled=false + - ES_JAVA_OPTS=-Xms512m -Xmx512m + ports: + - "9202:9200" + healthcheck: + test: curl -s http://localhost:9200 >/dev/null || exit 1 + interval: 10s + timeout: 5s + retries: 10 diff --git a/src/Mapping/Settings/Mapping/FieldSeparator.php b/src/Mapping/Settings/Mapping/FieldSeparator.php index 4d6cf63..e379bb1 100644 --- a/src/Mapping/Settings/Mapping/FieldSeparator.php +++ b/src/Mapping/Settings/Mapping/FieldSeparator.php @@ -1,7 +1,7 @@ index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -186,7 +186,7 @@ class AggregationCollection extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Avg.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Avg.phpt index 24df7bc..ca2c005 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Avg.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Avg.phpt @@ -14,7 +14,7 @@ class Avg extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -64,7 +64,7 @@ class Avg extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -89,7 +89,7 @@ class Avg extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Filter.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Filter.phpt index dd640ed..15d7004 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Filter.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Filter.phpt @@ -14,7 +14,7 @@ class Filter extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -76,7 +76,7 @@ class Filter extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -101,7 +101,7 @@ class Filter extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Histogram.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Histogram.phpt index 1a44991..46ac409 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Histogram.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Histogram.phpt @@ -14,7 +14,7 @@ class Histogram extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -65,7 +65,7 @@ class Histogram extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -90,7 +90,7 @@ class Histogram extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/LeafAggregationCollection.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/LeafAggregationCollection.phpt index 2ebf910..4600e58 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/LeafAggregationCollection.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/LeafAggregationCollection.phpt @@ -14,7 +14,7 @@ class LeafAggregationCollection extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -164,7 +164,7 @@ class LeafAggregationCollection extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -189,7 +189,7 @@ class LeafAggregationCollection extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Max.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Max.phpt index b03ac01..f71975b 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Max.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Max.phpt @@ -14,7 +14,7 @@ class Max extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -64,7 +64,7 @@ class Max extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -89,7 +89,7 @@ class Max extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Min.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Min.phpt index 38668c1..edd4272 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Min.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Min.phpt @@ -14,7 +14,7 @@ class Min extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -64,7 +64,7 @@ class Min extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -89,7 +89,7 @@ class Min extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Nested.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Nested.phpt index fa49443..7fbbd10 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Nested.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Nested.phpt @@ -14,7 +14,7 @@ class Nested extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -64,7 +64,7 @@ class Nested extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -89,7 +89,7 @@ class Nested extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Range.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Range.phpt index 987bbef..812dd24 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Range.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Range.phpt @@ -14,7 +14,7 @@ class Range extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -110,7 +110,7 @@ class Range extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -135,7 +135,7 @@ class Range extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Term.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Term.phpt index 7b85d78..ecd4e3f 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Term.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Term.phpt @@ -14,7 +14,7 @@ class Term extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -136,7 +136,7 @@ class Term extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -161,7 +161,7 @@ class Term extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/TopHits.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/TopHits.phpt index cdbb4d2..b3c741e 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/TopHits.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/TopHits.phpt @@ -14,7 +14,7 @@ class TopHits extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -64,7 +64,7 @@ class TopHits extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -89,7 +89,7 @@ class TopHits extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/ElasticQuery.phpt b/tests/SpameriTests/ElasticQuery/ElasticQuery.phpt index 2f56ad5..c3c06de 100644 --- a/tests/SpameriTests/ElasticQuery/ElasticQuery.phpt +++ b/tests/SpameriTests/ElasticQuery/ElasticQuery.phpt @@ -13,7 +13,7 @@ class ElasticQuery extends \Tester\TestCase public function setUp() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -24,7 +24,7 @@ class ElasticQuery extends \Tester\TestCase /// === $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX . '/_mapping'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX . '/_mapping'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -113,7 +113,7 @@ class ElasticQuery extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -137,7 +137,7 @@ class ElasticQuery extends \Tester\TestCase public function tearDown() : void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/ElasticsearchTestCase.php b/tests/SpameriTests/ElasticQuery/ElasticsearchTestCase.php new file mode 100644 index 0000000..faa4cb7 --- /dev/null +++ b/tests/SpameriTests/ElasticQuery/ElasticsearchTestCase.php @@ -0,0 +1,21 @@ +index . '/'); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/'); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -44,7 +44,7 @@ class CzechDictionary extends \Tester\TestCase // Fetch settings and test if analyzer is configured - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . $document->index . '/_settings'); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_settings'); \curl_setopt($ch, CURLOPT_POSTFIELDS, []); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); @@ -66,7 +66,7 @@ class CzechDictionary extends \Tester\TestCase $text = 'Playstation 4 je nejlepší se SodaStream drinkem a kouskem GS-condro!'; - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . $document->index . '/_analyze'); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_analyze'); \curl_setopt($ch, CURLOPT_POSTFIELDS, \json_encode([ 'text' => $text, 'analyzer' => 'czechDictionary', @@ -92,7 +92,7 @@ class CzechDictionary extends \Tester\TestCase protected function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt b/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt index b27b764..8166bc4 100644 --- a/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt @@ -14,7 +14,7 @@ class ElasticMatch extends \Tester\TestCase public function setUp() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -65,7 +65,7 @@ class ElasticMatch extends \Tester\TestCase ); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -89,7 +89,7 @@ class ElasticMatch extends \Tester\TestCase public function tearDown() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/Exists.phpt b/tests/SpameriTests/ElasticQuery/Query/Exists.phpt index 52c782b..8c1be3f 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Exists.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Exists.phpt @@ -14,7 +14,7 @@ class Exists extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -74,7 +74,7 @@ class Exists extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -99,7 +99,7 @@ class Exists extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt b/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt index 1355435..98d43dc 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt @@ -14,7 +14,7 @@ class Fuzzy extends \Tester\TestCase public function setUp() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -61,7 +61,7 @@ class Fuzzy extends \Tester\TestCase ); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -85,7 +85,7 @@ class Fuzzy extends \Tester\TestCase public function tearDown() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt b/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt index c1a92a0..f898979 100644 --- a/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt @@ -14,7 +14,7 @@ class MatchPhrase extends \Tester\TestCase public function setUp() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -59,7 +59,7 @@ class MatchPhrase extends \Tester\TestCase ); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -83,7 +83,7 @@ class MatchPhrase extends \Tester\TestCase public function tearDown() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/MultiMatch.phpt b/tests/SpameriTests/ElasticQuery/Query/MultiMatch.phpt index e2d3e6d..120a84a 100644 --- a/tests/SpameriTests/ElasticQuery/Query/MultiMatch.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/MultiMatch.phpt @@ -14,7 +14,7 @@ class MultiMatch extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -179,7 +179,7 @@ class MultiMatch extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -204,7 +204,7 @@ class MultiMatch extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/Nested.phpt b/tests/SpameriTests/ElasticQuery/Query/Nested.phpt index 2244e1d..a6bddc1 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Nested.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Nested.phpt @@ -14,7 +14,7 @@ class Nested extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -126,7 +126,7 @@ class Nested extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/PhrasePrefix.phpt b/tests/SpameriTests/ElasticQuery/Query/PhrasePrefix.phpt index 10fba95..b13819d 100644 --- a/tests/SpameriTests/ElasticQuery/Query/PhrasePrefix.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/PhrasePrefix.phpt @@ -14,7 +14,7 @@ class PhrasePrefix extends \Tester\TestCase public function setUp(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -93,7 +93,7 @@ class PhrasePrefix extends \Tester\TestCase ); $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -118,7 +118,7 @@ class PhrasePrefix extends \Tester\TestCase public function tearDown(): void { $ch = \curl_init(); - \curl_setopt($ch, \CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, \CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/Range.phpt b/tests/SpameriTests/ElasticQuery/Query/Range.phpt index ab5fbc9..e775548 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Range.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Range.phpt @@ -14,7 +14,7 @@ class Range extends \Tester\TestCase public function setUp() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -57,7 +57,7 @@ class Range extends \Tester\TestCase ); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -81,7 +81,7 @@ class Range extends \Tester\TestCase public function tearDown() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/Term.phpt b/tests/SpameriTests/ElasticQuery/Query/Term.phpt index d8f7de0..58d8618 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Term.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Term.phpt @@ -14,7 +14,7 @@ class Term extends \Tester\TestCase public function setUp() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -55,7 +55,7 @@ class Term extends \Tester\TestCase ); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -79,7 +79,7 @@ class Term extends \Tester\TestCase public function tearDown() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/Terms.phpt b/tests/SpameriTests/ElasticQuery/Query/Terms.phpt index 0d6a2f0..d277c4e 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Terms.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Terms.phpt @@ -14,7 +14,7 @@ class Terms extends \Tester\TestCase public function setUp() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -54,7 +54,7 @@ class Terms extends \Tester\TestCase ); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -78,7 +78,7 @@ class Terms extends \Tester\TestCase public function tearDown() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt b/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt index 68aafa0..0840616 100644 --- a/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt @@ -14,7 +14,7 @@ class WildCard extends \Tester\TestCase public function setUp() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -55,7 +55,7 @@ class WildCard extends \Tester\TestCase ); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . $document->index . '/_search'); + curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . $document->index . '/_search'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); @@ -79,7 +79,7 @@ class WildCard extends \Tester\TestCase public function tearDown() : void { $ch = \curl_init(); - \curl_setopt($ch, CURLOPT_URL, 'localhost:9200/' . self::INDEX . '/'); + \curl_setopt($ch, CURLOPT_URL, \ELASTICSEARCH_HOST . '/' . self::INDEX . '/'); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); diff --git a/tests/SpameriTests/ElasticQuery/Response/ResultVersion.phpt b/tests/SpameriTests/ElasticQuery/Response/ResultVersion.phpt index 6c30daa..6b438fb 100644 --- a/tests/SpameriTests/ElasticQuery/Response/ResultVersion.phpt +++ b/tests/SpameriTests/ElasticQuery/Response/ResultVersion.phpt @@ -13,13 +13,29 @@ class ResultVersion extends \Tester\TestCase { $resultMapper = new \Spameri\ElasticQuery\Response\ResultMapper(); /** @var \Spameri\ElasticQuery\Response\ResultVersion $resultObject */ - $resultObject = $resultMapper->map(\json_decode(\file_get_contents('http://127.0.0.1:9200'), TRUE)); + $resultObject = $resultMapper->map(\json_decode(\file_get_contents('http://' . \ELASTICSEARCH_HOST), TRUE)); \Tester\Assert::true($resultObject instanceof \Spameri\ElasticQuery\Response\ResultVersion); - if (\Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_7 <= $resultObject->version()->id()) { + if (\Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_9 <= $resultObject->version()->id()) { \Tester\Assert::true( - \Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_7 < $resultObject->version()->id() + \Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_9 <= $resultObject->version()->id() + ); + \Tester\Assert::true( + \Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_10 > $resultObject->version()->id() + ); + + } elseif (\Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_8 <= $resultObject->version()->id()) { + \Tester\Assert::true( + \Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_8 <= $resultObject->version()->id() + ); + \Tester\Assert::true( + \Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_9 > $resultObject->version()->id() + ); + + } elseif (\Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_7 <= $resultObject->version()->id()) { + \Tester\Assert::true( + \Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_7 <= $resultObject->version()->id() ); \Tester\Assert::true( \Spameri\ElasticQuery\Response\Result\Version::ELASTIC_VERSION_ID_8 > $resultObject->version()->id() diff --git a/tests/SpameriTests/ElasticQuery/VersionCheck.php b/tests/SpameriTests/ElasticQuery/VersionCheck.php index 8ae2373..21c0b8e 100644 --- a/tests/SpameriTests/ElasticQuery/VersionCheck.php +++ b/tests/SpameriTests/ElasticQuery/VersionCheck.php @@ -19,7 +19,7 @@ public static function check(): \Spameri\ElasticQuery\Response\ResultVersion /** @var \Spameri\ElasticQuery\Response\ResultVersion $resultObject */ $resultObject = self::$resultMapper->map( \json_decode( - (string) \file_get_contents('http://127.0.0.1:9200'), + (string) \file_get_contents(ElasticsearchTestCase::getBaseUrl()), true, ), ); diff --git a/tests/SpameriTests/bootstrap.php b/tests/SpameriTests/bootstrap.php index bdfc815..b29e3cb 100644 --- a/tests/SpameriTests/bootstrap.php +++ b/tests/SpameriTests/bootstrap.php @@ -19,5 +19,7 @@ \Tester\Environment::setup(); \date_default_timezone_set('Europe/Prague'); +// Elasticsearch host configuration (can be overridden via environment variable) +\define('ELASTICSEARCH_HOST', \getenv('ELASTICSEARCH_HOST') ?: 'localhost:9200'); return $loader; From d4c3fc4acea25e2c25d22775177132ac0089d463 Mon Sep 17 00:00:00 2001 From: Spamer Date: Thu, 18 Dec 2025 15:18:35 +0100 Subject: [PATCH 03/10] bump version and fix url --- .github/workflows/ci.yml | 2 +- composer.json | 7 ++++--- tests/SpameriTests/bootstrap.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29c7847..b80e787 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,4 +44,4 @@ jobs: - name: Tests run: make tests env: - ELASTICSEARCH_HOST: localhost:9200 + ELASTICSEARCH_HOST: http://localhost:9200 diff --git a/composer.json b/composer.json index addd582..a4457db 100644 --- a/composer.json +++ b/composer.json @@ -18,8 +18,8 @@ "ext-curl": "*", "phpstan/phpstan": "^1.11.3", "nette/tester": "v2.3.1", - "elasticsearch/elasticsearch": "^7", - "guzzlehttp/guzzle": "^6.3", + "elasticsearch/elasticsearch": "^9.0.0", + "guzzlehttp/guzzle": "^7.0", "slevomat/coding-standard": "^8.0" }, "autoload": { @@ -34,7 +34,8 @@ }, "config": { "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true + "dealerdirect/phpcodesniffer-composer-installer": true, + "php-http/discovery": true } }, "brach-alias": { diff --git a/tests/SpameriTests/bootstrap.php b/tests/SpameriTests/bootstrap.php index b29e3cb..4ce5165 100644 --- a/tests/SpameriTests/bootstrap.php +++ b/tests/SpameriTests/bootstrap.php @@ -20,6 +20,6 @@ \date_default_timezone_set('Europe/Prague'); // Elasticsearch host configuration (can be overridden via environment variable) -\define('ELASTICSEARCH_HOST', \getenv('ELASTICSEARCH_HOST') ?: 'localhost:9200'); +\define('ELASTICSEARCH_HOST', \getenv('ELASTICSEARCH_HOST') ?: 'http://localhost:9200'); return $loader; From 8882c397727aaef1546bbad5c1c797cf17ca3171 Mon Sep 17 00:00:00 2001 From: Spamer Date: Thu, 18 Dec 2025 15:27:58 +0100 Subject: [PATCH 04/10] bump version and fix url --- tests/SpameriTests/ElasticQuery/Query/WildCard.phpt | 7 +++++-- .../SpameriTests/ElasticQuery/Response/ResultVersion.phpt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt b/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt index 0840616..09b50af 100644 --- a/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt @@ -65,10 +65,13 @@ class WildCard extends \Tester\TestCase ); \Tester\Assert::noError(static function () use ($ch) { - $response = curl_exec($ch); + $response = \curl_exec($ch); + if ($response === false) { + throw new \RuntimeException('Curl request failed: ' . \curl_error($ch)); + } $resultMapper = new \Spameri\ElasticQuery\Response\ResultMapper(); /** @var \Spameri\ElasticQuery\Response\ResultSearch $result */ - $result = $resultMapper->map(\json_decode($response, TRUE)); + $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type('int', $result->stats()->total()); }); diff --git a/tests/SpameriTests/ElasticQuery/Response/ResultVersion.phpt b/tests/SpameriTests/ElasticQuery/Response/ResultVersion.phpt index 6b438fb..4825066 100644 --- a/tests/SpameriTests/ElasticQuery/Response/ResultVersion.phpt +++ b/tests/SpameriTests/ElasticQuery/Response/ResultVersion.phpt @@ -13,7 +13,7 @@ class ResultVersion extends \Tester\TestCase { $resultMapper = new \Spameri\ElasticQuery\Response\ResultMapper(); /** @var \Spameri\ElasticQuery\Response\ResultVersion $resultObject */ - $resultObject = $resultMapper->map(\json_decode(\file_get_contents('http://' . \ELASTICSEARCH_HOST), TRUE)); + $resultObject = $resultMapper->map(\json_decode(\file_get_contents(\ELASTICSEARCH_HOST), TRUE)); \Tester\Assert::true($resultObject instanceof \Spameri\ElasticQuery\Response\ResultVersion); From 207caba8d4e2eafc478ae36e072084ecb500c951 Mon Sep 17 00:00:00 2001 From: Spamer Date: Thu, 18 Dec 2025 15:45:08 +0100 Subject: [PATCH 05/10] bump --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b80e787..10a4baa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,4 +44,4 @@ jobs: - name: Tests run: make tests env: - ELASTICSEARCH_HOST: http://localhost:9200 + ELASTICSEARCH_HOST: https://es1:9200 From 5c17c48010ff9c327d8a8fb4ba288871de6c9b8e Mon Sep 17 00:00:00 2001 From: Spamer Date: Thu, 18 Dec 2025 15:55:01 +0100 Subject: [PATCH 06/10] bump --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10a4baa..af88f0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: uses: elastic/elastic-github-actions/elasticsearch@master with: stack-version: ${{ matrix.elastic }} + security-enabled: false - name: Composer run: make composer @@ -44,4 +45,4 @@ jobs: - name: Tests run: make tests env: - ELASTICSEARCH_HOST: https://es1:9200 + ELASTICSEARCH_HOST: http://localhost:9200 From 788d4d520fcb2e171b0d1338765ddaba99589ceb Mon Sep 17 00:00:00 2001 From: Spamer Date: Thu, 18 Dec 2025 16:02:39 +0100 Subject: [PATCH 07/10] php 8.5 --- src/Aggregation/Range.php | 6 +----- src/Exception/ResponseCouldNotBeMapped.php | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Aggregation/Range.php b/src/Aggregation/Range.php index 5fd51f2..835bd8c 100644 --- a/src/Aggregation/Range.php +++ b/src/Aggregation/Range.php @@ -11,16 +11,12 @@ class Range implements LeafAggregationInterface { - private \Spameri\ElasticQuery\Aggregation\RangeValueCollection $ranges; - - public function __construct( private string $field, private bool $keyed = false, - \Spameri\ElasticQuery\Aggregation\RangeValueCollection $rangeValueCollection = null, + private \Spameri\ElasticQuery\Aggregation\RangeValueCollection $ranges = new \Spameri\ElasticQuery\Aggregation\RangeValueCollection(), ) { - $this->ranges = $rangeValueCollection ?: new \Spameri\ElasticQuery\Aggregation\RangeValueCollection(); } diff --git a/src/Exception/ResponseCouldNotBeMapped.php b/src/Exception/ResponseCouldNotBeMapped.php index d4a9fa4..75de6c0 100644 --- a/src/Exception/ResponseCouldNotBeMapped.php +++ b/src/Exception/ResponseCouldNotBeMapped.php @@ -11,7 +11,7 @@ class ResponseCouldNotBeMapped extends \InvalidArgumentException public function __construct( string $message, int $code = 0, - \Throwable $previous = null, + \Throwable|null $previous = null, ) { parent::__construct((string) \json_encode($message), $code, $previous); From 7d84f3bab6dc684e8ee166c8ebfd28d2e000452f Mon Sep 17 00:00:00 2001 From: Spamer Date: Thu, 18 Dec 2025 16:06:58 +0100 Subject: [PATCH 08/10] php 8.5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a4457db..d956f49 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require-dev": { "ext-curl": "*", "phpstan/phpstan": "^1.11.3", - "nette/tester": "v2.3.1", + "nette/tester": "v2.5.7", "elasticsearch/elasticsearch": "^9.0.0", "guzzlehttp/guzzle": "^7.0", "slevomat/coding-standard": "^8.0" From bc6d3e2563f63e213d63576ce725a1a368514fdc Mon Sep 17 00:00:00 2001 From: Spamer Date: Thu, 18 Dec 2025 16:14:33 +0100 Subject: [PATCH 09/10] php 8.5 --- .../ElasticQuery/Aggregation/AggregationCollection.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Aggregation/Avg.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Aggregation/Filter.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Aggregation/Histogram.phpt | 4 ---- .../ElasticQuery/Aggregation/LeafAggregationCollection.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Aggregation/Max.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Aggregation/Min.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Aggregation/Nested.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Aggregation/Range.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Aggregation/Term.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Aggregation/TopHits.phpt | 4 ---- tests/SpameriTests/ElasticQuery/ElasticQuery.phpt | 5 ----- .../Mapping/Analyzer/Custom/CzechDictionary.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/Exists.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/MultiMatch.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Query/Nested.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/PhrasePrefix.phpt | 4 ---- tests/SpameriTests/ElasticQuery/Query/Range.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/Term.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/Terms.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/WildCard.phpt | 2 -- 24 files changed, 81 deletions(-) diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/AggregationCollection.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/AggregationCollection.phpt index 1fcaa38..f998dda 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/AggregationCollection.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/AggregationCollection.phpt @@ -20,7 +20,6 @@ class AggregationCollection extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -178,8 +177,6 @@ class AggregationCollection extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -192,7 +189,6 @@ class AggregationCollection extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Avg.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Avg.phpt index ca2c005..f3ae24f 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Avg.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Avg.phpt @@ -20,7 +20,6 @@ class Avg extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -81,8 +80,6 @@ class Avg extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -95,7 +92,6 @@ class Avg extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Filter.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Filter.phpt index 15d7004..0cea8ee 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Filter.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Filter.phpt @@ -20,7 +20,6 @@ class Filter extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -93,8 +92,6 @@ class Filter extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -107,7 +104,6 @@ class Filter extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Histogram.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Histogram.phpt index 46ac409..2065824 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Histogram.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Histogram.phpt @@ -20,7 +20,6 @@ class Histogram extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -82,8 +81,6 @@ class Histogram extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -96,7 +93,6 @@ class Histogram extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/LeafAggregationCollection.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/LeafAggregationCollection.phpt index 4600e58..1cbe748 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/LeafAggregationCollection.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/LeafAggregationCollection.phpt @@ -20,7 +20,6 @@ class LeafAggregationCollection extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -181,8 +180,6 @@ class LeafAggregationCollection extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -195,7 +192,6 @@ class LeafAggregationCollection extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Max.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Max.phpt index f71975b..99aa685 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Max.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Max.phpt @@ -20,7 +20,6 @@ class Max extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -81,8 +80,6 @@ class Max extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -95,7 +92,6 @@ class Max extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Min.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Min.phpt index edd4272..d6d372e 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Min.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Min.phpt @@ -20,7 +20,6 @@ class Min extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -81,8 +80,6 @@ class Min extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -95,7 +92,6 @@ class Min extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Nested.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Nested.phpt index 7fbbd10..935c9bf 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Nested.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Nested.phpt @@ -20,7 +20,6 @@ class Nested extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -81,8 +80,6 @@ class Nested extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -95,7 +92,6 @@ class Nested extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Range.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Range.phpt index 812dd24..65db983 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Range.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Range.phpt @@ -20,7 +20,6 @@ class Range extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -127,8 +126,6 @@ class Range extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -141,7 +138,6 @@ class Range extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/Term.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/Term.phpt index ecd4e3f..2cfe880 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/Term.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/Term.phpt @@ -20,7 +20,6 @@ class Term extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -153,8 +152,6 @@ class Term extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -167,7 +164,6 @@ class Term extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Aggregation/TopHits.phpt b/tests/SpameriTests/ElasticQuery/Aggregation/TopHits.phpt index b3c741e..44d3028 100644 --- a/tests/SpameriTests/ElasticQuery/Aggregation/TopHits.phpt +++ b/tests/SpameriTests/ElasticQuery/Aggregation/TopHits.phpt @@ -20,7 +20,6 @@ class TopHits extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -81,8 +80,6 @@ class TopHits extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type(\Spameri\ElasticQuery\Response\ResultSearch::class, $result); }); - - \curl_close($ch); } @@ -95,7 +92,6 @@ class TopHits extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/ElasticQuery.phpt b/tests/SpameriTests/ElasticQuery/ElasticQuery.phpt index c3c06de..ea2b364 100644 --- a/tests/SpameriTests/ElasticQuery/ElasticQuery.phpt +++ b/tests/SpameriTests/ElasticQuery/ElasticQuery.phpt @@ -19,7 +19,6 @@ class ElasticQuery extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); /// === @@ -43,7 +42,6 @@ class ElasticQuery extends \Tester\TestCase ); \curl_exec($ch); - \curl_close($ch); } @@ -129,8 +127,6 @@ class ElasticQuery extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, TRUE)); \Tester\Assert::type('int', $result->stats()->total()); }); - - \curl_close($ch); } @@ -143,7 +139,6 @@ class ElasticQuery extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Mapping/Analyzer/Custom/CzechDictionary.phpt b/tests/SpameriTests/ElasticQuery/Mapping/Analyzer/Custom/CzechDictionary.phpt index 10ee70e..e8f5521 100644 --- a/tests/SpameriTests/ElasticQuery/Mapping/Analyzer/Custom/CzechDictionary.phpt +++ b/tests/SpameriTests/ElasticQuery/Mapping/Analyzer/Custom/CzechDictionary.phpt @@ -84,8 +84,6 @@ class CzechDictionary extends \Tester\TestCase \Tester\Assert::same('lepsi', $responseAnalyzer['tokens'][2]['token']); \Tester\Assert::same('drink', $responseAnalyzer['tokens'][4]['token']); \Tester\Assert::same('kousek', $responseAnalyzer['tokens'][5]['token']); - - \curl_close($ch); } @@ -98,8 +96,6 @@ class CzechDictionary extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt b/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt index 8166bc4..83d32d4 100644 --- a/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt @@ -20,7 +20,6 @@ class ElasticMatch extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -95,7 +94,6 @@ class ElasticMatch extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/Exists.phpt b/tests/SpameriTests/ElasticQuery/Query/Exists.phpt index 8c1be3f..f0552dd 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Exists.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Exists.phpt @@ -20,7 +20,6 @@ class Exists extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -91,8 +90,6 @@ class Exists extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type('int', $result->stats()->total()); }); - - \curl_close($ch); } @@ -105,7 +102,6 @@ class Exists extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt b/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt index 98d43dc..49ff66d 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt @@ -20,7 +20,6 @@ class Fuzzy extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -91,7 +90,6 @@ class Fuzzy extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt b/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt index f898979..f0f5e93 100644 --- a/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt @@ -20,7 +20,6 @@ class MatchPhrase extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -89,7 +88,6 @@ class MatchPhrase extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/MultiMatch.phpt b/tests/SpameriTests/ElasticQuery/Query/MultiMatch.phpt index 120a84a..72e09e5 100644 --- a/tests/SpameriTests/ElasticQuery/Query/MultiMatch.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/MultiMatch.phpt @@ -20,7 +20,6 @@ class MultiMatch extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -196,8 +195,6 @@ class MultiMatch extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type('int', $result->stats()->total()); }); - - \curl_close($ch); } @@ -210,7 +207,6 @@ class MultiMatch extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/Nested.phpt b/tests/SpameriTests/ElasticQuery/Query/Nested.phpt index a6bddc1..ff0debf 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Nested.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Nested.phpt @@ -20,7 +20,6 @@ class Nested extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -132,7 +131,6 @@ class Nested extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/PhrasePrefix.phpt b/tests/SpameriTests/ElasticQuery/Query/PhrasePrefix.phpt index b13819d..806797d 100644 --- a/tests/SpameriTests/ElasticQuery/Query/PhrasePrefix.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/PhrasePrefix.phpt @@ -20,7 +20,6 @@ class PhrasePrefix extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -110,8 +109,6 @@ class PhrasePrefix extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type('int', $result->stats()->total()); }); - - \curl_close($ch); } @@ -124,7 +121,6 @@ class PhrasePrefix extends \Tester\TestCase \curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/Range.phpt b/tests/SpameriTests/ElasticQuery/Query/Range.phpt index e775548..26cc123 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Range.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Range.phpt @@ -20,7 +20,6 @@ class Range extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -87,7 +86,6 @@ class Range extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/Term.phpt b/tests/SpameriTests/ElasticQuery/Query/Term.phpt index 58d8618..3f66add 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Term.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Term.phpt @@ -20,7 +20,6 @@ class Term extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -85,7 +84,6 @@ class Term extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/Terms.phpt b/tests/SpameriTests/ElasticQuery/Query/Terms.phpt index d277c4e..6412d2a 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Terms.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Terms.phpt @@ -20,7 +20,6 @@ class Terms extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } public function testCreate() : void @@ -84,7 +83,6 @@ class Terms extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } diff --git a/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt b/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt index 09b50af..4f71fc8 100644 --- a/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt @@ -20,7 +20,6 @@ class WildCard extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } @@ -88,7 +87,6 @@ class WildCard extends \Tester\TestCase \curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); \curl_exec($ch); - \curl_close($ch); } } From 6ee09678c4f6876d98a680879068c75b85e6d456 Mon Sep 17 00:00:00 2001 From: Spamer Date: Thu, 18 Dec 2025 16:27:53 +0100 Subject: [PATCH 10/10] php 8.5 --- tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/Range.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/Term.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/Terms.phpt | 2 -- tests/SpameriTests/ElasticQuery/Query/WildCard.phpt | 2 -- 7 files changed, 14 deletions(-) diff --git a/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt b/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt index 83d32d4..39230cf 100644 --- a/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/ElasticMatch.phpt @@ -80,8 +80,6 @@ class ElasticMatch extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, TRUE)); \Tester\Assert::type('int', $result->stats()->total()); }); - - curl_close($ch); } diff --git a/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt b/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt index 49ff66d..0880bf9 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt @@ -76,8 +76,6 @@ class Fuzzy extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, TRUE)); \Tester\Assert::type('int', $result->stats()->total()); }); - - curl_close($ch); } diff --git a/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt b/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt index f0f5e93..e91013a 100644 --- a/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt @@ -74,8 +74,6 @@ class MatchPhrase extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, TRUE)); \Tester\Assert::type('int', $result->stats()->total()); }); - - curl_close($ch); } diff --git a/tests/SpameriTests/ElasticQuery/Query/Range.phpt b/tests/SpameriTests/ElasticQuery/Query/Range.phpt index 26cc123..3d969cc 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Range.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Range.phpt @@ -72,8 +72,6 @@ class Range extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, TRUE)); \Tester\Assert::type('int', $result->stats()->total()); }); - - curl_close($ch); } diff --git a/tests/SpameriTests/ElasticQuery/Query/Term.phpt b/tests/SpameriTests/ElasticQuery/Query/Term.phpt index 3f66add..b445579 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Term.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Term.phpt @@ -70,8 +70,6 @@ class Term extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, TRUE)); \Tester\Assert::type('int', $result->stats()->total()); }); - - curl_close($ch); } diff --git a/tests/SpameriTests/ElasticQuery/Query/Terms.phpt b/tests/SpameriTests/ElasticQuery/Query/Terms.phpt index 6412d2a..edde1e6 100644 --- a/tests/SpameriTests/ElasticQuery/Query/Terms.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/Terms.phpt @@ -69,8 +69,6 @@ class Terms extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, TRUE)); \Tester\Assert::type('int', $result->stats()->total()); }); - - curl_close($ch); } diff --git a/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt b/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt index 4f71fc8..f69290a 100644 --- a/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt +++ b/tests/SpameriTests/ElasticQuery/Query/WildCard.phpt @@ -73,8 +73,6 @@ class WildCard extends \Tester\TestCase $result = $resultMapper->map(\json_decode($response, true)); \Tester\Assert::type('int', $result->stats()->total()); }); - - curl_close($ch); }