From 4a266cda5a4c84ce798014c7b844bb2f6ec30925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simonas=20=C5=A0erlinskas?= <simonas.serlinskas@nfq.com> Date: Mon, 29 Jun 2015 15:30:36 +0300 Subject: [PATCH] renamed tests namespaces after move from ESB --- .../CardinalityAggregationTest.php | 4 +- tests/Aggregation/ChildrenAggregationTest.php | 6 +- .../Aggregation/DateRangeAggregationTest.php | 4 +- tests/Aggregation/FilterAggregationTest.php | 12 +- tests/Aggregation/FiltersAggregationTest.php | 10 +- .../Aggregation/GeoBoundsAggregationTest.php | 4 +- .../GeoDistanceAggregationTest.php | 4 +- .../GeoHashGridAggregationTest.php | 4 +- tests/Aggregation/GlobalAggregationTest.php | 4 +- .../Aggregation/Ipv4RangeAggregationTest.php | 4 +- tests/Aggregation/MissingAggregationTest.php | 4 +- tests/Aggregation/NestedAggregationTest.php | 6 +- .../PercentileRanksAggregationTest.php | 4 +- .../PercentilesAggregationTest.php | 4 +- tests/Aggregation/RangeAggregationTest.php | 4 +- .../ReverseNestedAggregationTest.php | 8 +- tests/Aggregation/StatsAggregationTest.php | 4 +- tests/Aggregation/TermsAggregationTest.php | 6 +- tests/Aggregation/TopHitsAggregationTest.php | 6 +- tests/Bool/BoolTest.php | 8 +- tests/DslTypeAwareTraitTest.php | 6 +- tests/Filter/AndFilterTest.php | 8 +- tests/Filter/ExistsFilterTest.php | 4 +- tests/Filter/GeoBoundingBoxFilterTest.php | 4 +- tests/Filter/GeoDistanceFilterTest.php | 4 +- tests/Filter/GeoDistanceRangeFilterTest.php | 4 +- tests/Filter/GeoPolygonFilterTest.php | 4 +- tests/Filter/HasChildFilterTest.php | 8 +- tests/Filter/HasParentFilterTest.php | 8 +- tests/Filter/IdsFilterTest.php | 4 +- tests/Filter/IndicesFilterTest.php | 6 +- tests/Filter/LimitFilterTest.php | 4 +- tests/Filter/MatchAllFilterTest.php | 4 +- tests/Filter/MissingFilterTest.php | 4 +- tests/Filter/NestedFilterTest.php | 8 +- tests/Filter/NotFilterTest.php | 6 +- tests/Filter/OrFilterTest.php | 8 +- tests/Filter/PostFilterTest.php | 6 +- tests/Filter/PrefixFilterTest.php | 4 +- tests/Filter/QueryFilterTest.php | 8 +- tests/Filter/RangeFilterTest.php | 4 +- tests/Filter/RegexpFilterTest.php | 4 +- tests/Filter/ScriptFilterTest.php | 4 +- tests/Filter/TermFilterTest.php | 4 +- tests/Filter/TermsFilterTest.php | 4 +- tests/Filter/TypeFilterTest.php | 4 +- tests/Highlight/FieldTest.php | 6 +- tests/Highlight/HighlightTest.php | 6 +- tests/NamedBuilderBagTest.php | 8 +- tests/ParametersTraitTest.php | 6 +- tests/Query/HasChildQueryTest.php | 6 +- tests/Query/HasParentQueryTest.php | 6 +- tests/Query/IndicesQueryTest.php | 10 +- tests/Query/NestedQueryTest.php | 6 +- tests/Query/QueryTest.php | 12 +- tests/Query/Span/SpanFirstQueryTest.php | 8 +- tests/Query/Span/SpanMultiTermQueryTest.php | 10 +- tests/Query/Span/SpanNearQueryTest.php | 8 +- tests/Query/Span/SpanNotQueryTest.php | 8 +- tests/Query/Span/SpanOrQueryTest.php | 8 +- tests/Query/Span/SpanTermQueryTest.php | 4 +- .../SearchEndpointFactoryTest.php | 4 +- tests/Suggester/CompletionTest.php | 153 ----------------- .../Suggester/Context/CategoryContextTest.php | 41 ----- tests/Suggester/Context/GeoContextTest.php | 43 ----- tests/Suggester/ContextTest.php | 69 -------- tests/Suggester/PhraseTest.php | 130 --------------- tests/Suggester/TermTest.php | 156 ------------------ 68 files changed, 181 insertions(+), 773 deletions(-) delete mode 100644 tests/Suggester/CompletionTest.php delete mode 100644 tests/Suggester/Context/CategoryContextTest.php delete mode 100644 tests/Suggester/Context/GeoContextTest.php delete mode 100644 tests/Suggester/ContextTest.php delete mode 100644 tests/Suggester/PhraseTest.php delete mode 100644 tests/Suggester/TermTest.php diff --git a/tests/Aggregation/CardinalityAggregationTest.php b/tests/Aggregation/CardinalityAggregationTest.php index 75b9d19..607948f 100644 --- a/tests/Aggregation/CardinalityAggregationTest.php +++ b/tests/Aggregation/CardinalityAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\CardinalityAggregation; +use ONGR\ElasticsearchDSL\Aggregation\CardinalityAggregation; /** * Unit test for cardinality aggregation. diff --git a/tests/Aggregation/ChildrenAggregationTest.php b/tests/Aggregation/ChildrenAggregationTest.php index 11e4446..ceb7e3d 100644 --- a/tests/Aggregation/ChildrenAggregationTest.php +++ b/tests/Aggregation/ChildrenAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\ChildrenAggregation; +use ONGR\ElasticsearchDSL\Aggregation\ChildrenAggregation; /** * Unit test for children aggregation. @@ -44,7 +44,7 @@ class ChildrenAggregationTest extends \PHPUnit_Framework_TestCase */ public function testChildrenAggregationGetArray() { - $mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Aggregation\AbstractAggregation') + $mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Aggregation\AbstractAggregation') ->disableOriginalConstructor() ->getMockForAbstractClass(); $aggregation = new ChildrenAggregation('foo'); diff --git a/tests/Aggregation/DateRangeAggregationTest.php b/tests/Aggregation/DateRangeAggregationTest.php index f2643ad..45ec226 100644 --- a/tests/Aggregation/DateRangeAggregationTest.php +++ b/tests/Aggregation/DateRangeAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\DateRangeAggregation; +use ONGR\ElasticsearchDSL\Aggregation\DateRangeAggregation; class DateRangeAggregationTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Aggregation/FilterAggregationTest.php b/tests/Aggregation/FilterAggregationTest.php index 520c18b..385a94b 100644 --- a/tests/Aggregation/FilterAggregationTest.php +++ b/tests/Aggregation/FilterAggregationTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\FilterAggregation; -use ONGR\ElasticsearchBundle\DSL\Filter\AndFilter; -use ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter; +use ONGR\ElasticsearchDSL\Aggregation\FilterAggregation; +use ONGR\ElasticsearchDSL\Filter\AndFilter; +use ONGR\ElasticsearchDSL\Filter\MissingFilter; class FilterAggregationTest extends \PHPUnit_Framework_TestCase { @@ -29,7 +29,7 @@ class FilterAggregationTest extends \PHPUnit_Framework_TestCase // Case #0 filter aggregation. $aggregation = new FilterAggregation('test_agg'); - $filter = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface') + $filter = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') ->setMethods(['toArray', 'getType']) ->getMockForAbstractClass(); $filter->expects($this->any()) @@ -60,7 +60,7 @@ class FilterAggregationTest extends \PHPUnit_Framework_TestCase $aggregation = new FilterAggregation('test_agg'); $aggregation->setFilter($filter); - $aggregation2 = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Aggregation\AbstractAggregation') + $aggregation2 = $this->getMockBuilder('ONGR\ElasticsearchDSL\Aggregation\AbstractAggregation') ->disableOriginalConstructor() ->setMethods(['toArray', 'getName']) ->getMockForAbstractClass(); diff --git a/tests/Aggregation/FiltersAggregationTest.php b/tests/Aggregation/FiltersAggregationTest.php index 38c9cae..4f541be 100644 --- a/tests/Aggregation/FiltersAggregationTest.php +++ b/tests/Aggregation/FiltersAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\FiltersAggregation; +use ONGR\ElasticsearchDSL\Aggregation\FiltersAggregation; /** * Unit test for filters aggregation. @@ -26,7 +26,7 @@ class FiltersAggregationTest extends \PHPUnit_Framework_TestCase */ public function testIfExceptionIsThrown() { - $mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface')->getMock(); + $mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface')->getMock(); $aggregation = new FiltersAggregation('test_agg'); $aggregation->addFilter($mock); } @@ -36,7 +36,7 @@ class FiltersAggregationTest extends \PHPUnit_Framework_TestCase */ public function testFiltersAggregationGetArray() { - $mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface')->getMock(); + $mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface')->getMock(); $aggregation = new FiltersAggregation('test_agg'); $aggregation->setAnonymous(true); $aggregation->addFilter($mock, 'name'); @@ -60,7 +60,7 @@ class FiltersAggregationTest extends \PHPUnit_Framework_TestCase public function testToArray() { $aggregation = new FiltersAggregation('test_agg'); - $filter = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface') + $filter = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') ->setMethods(['toArray', 'getType']) ->getMockForAbstractClass(); $filter->expects($this->any()) diff --git a/tests/Aggregation/GeoBoundsAggregationTest.php b/tests/Aggregation/GeoBoundsAggregationTest.php index 829f371..d38aa25 100644 --- a/tests/Aggregation/GeoBoundsAggregationTest.php +++ b/tests/Aggregation/GeoBoundsAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\GeoBoundsAggregation; +use ONGR\ElasticsearchDSL\Aggregation\GeoBoundsAggregation; /** * Unit test for geo bounds aggregation. diff --git a/tests/Aggregation/GeoDistanceAggregationTest.php b/tests/Aggregation/GeoDistanceAggregationTest.php index 4dd3e0e..0379ab0 100644 --- a/tests/Aggregation/GeoDistanceAggregationTest.php +++ b/tests/Aggregation/GeoDistanceAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\GeoDistanceAggregation; +use ONGR\ElasticsearchDSL\Aggregation\GeoDistanceAggregation; class GeoDistanceAggregationTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Aggregation/GeoHashGridAggregationTest.php b/tests/Aggregation/GeoHashGridAggregationTest.php index aac5726..489d171 100644 --- a/tests/Aggregation/GeoHashGridAggregationTest.php +++ b/tests/Aggregation/GeoHashGridAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\GeoHashGridAggregation; +use ONGR\ElasticsearchDSL\Aggregation\GeoHashGridAggregation; /** * Unit test for geohash grid aggregation. diff --git a/tests/Aggregation/GlobalAggregationTest.php b/tests/Aggregation/GlobalAggregationTest.php index 351c27e..49ae84b 100644 --- a/tests/Aggregation/GlobalAggregationTest.php +++ b/tests/Aggregation/GlobalAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\GlobalAggregation; +use ONGR\ElasticsearchDSL\Aggregation\GlobalAggregation; class GlobalAggregationTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Aggregation/Ipv4RangeAggregationTest.php b/tests/Aggregation/Ipv4RangeAggregationTest.php index 0011122..eb3a27e 100644 --- a/tests/Aggregation/Ipv4RangeAggregationTest.php +++ b/tests/Aggregation/Ipv4RangeAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\Ipv4RangeAggregation; +use ONGR\ElasticsearchDSL\Aggregation\Ipv4RangeAggregation; class Ipv4RangeAggregationTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Aggregation/MissingAggregationTest.php b/tests/Aggregation/MissingAggregationTest.php index 300971e..1caae74 100644 --- a/tests/Aggregation/MissingAggregationTest.php +++ b/tests/Aggregation/MissingAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\MissingAggregation; +use ONGR\ElasticsearchDSL\Aggregation\MissingAggregation; class MissingAggregationTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Aggregation/NestedAggregationTest.php b/tests/Aggregation/NestedAggregationTest.php index 500ccb5..941060d 100644 --- a/tests/Aggregation/NestedAggregationTest.php +++ b/tests/Aggregation/NestedAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\NestedAggregation; +use ONGR\ElasticsearchDSL\Aggregation\NestedAggregation; class NestedAggregationTest extends \PHPUnit_Framework_TestCase { @@ -40,7 +40,7 @@ class NestedAggregationTest extends \PHPUnit_Framework_TestCase public function testToArray() { $termMock = $this - ->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Aggregation\TermsAggregation') + ->getMockBuilder('ONGR\ElasticsearchDSL\Aggregation\TermsAggregation') ->disableOriginalConstructor() ->getMock(); diff --git a/tests/Aggregation/PercentileRanksAggregationTest.php b/tests/Aggregation/PercentileRanksAggregationTest.php index a063b36..5ac3485 100644 --- a/tests/Aggregation/PercentileRanksAggregationTest.php +++ b/tests/Aggregation/PercentileRanksAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\PercentileRanksAggregation; +use ONGR\ElasticsearchDSL\Aggregation\PercentileRanksAggregation; /** * Percentile ranks aggregation unit tests. diff --git a/tests/Aggregation/PercentilesAggregationTest.php b/tests/Aggregation/PercentilesAggregationTest.php index f7d1fd7..9ab92e4 100644 --- a/tests/Aggregation/PercentilesAggregationTest.php +++ b/tests/Aggregation/PercentilesAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\PercentilesAggregation; +use ONGR\ElasticsearchDSL\Aggregation\PercentilesAggregation; class PercentilesAggregationTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Aggregation/RangeAggregationTest.php b/tests/Aggregation/RangeAggregationTest.php index fe8c317..9414ea5 100644 --- a/tests/Aggregation/RangeAggregationTest.php +++ b/tests/Aggregation/RangeAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\RangeAggregation; +use ONGR\ElasticsearchDSL\Aggregation\RangeAggregation; class RangeAggregationTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Aggregation/ReverseNestedAggregationTest.php b/tests/Aggregation/ReverseNestedAggregationTest.php index e4e8eee..2b401ec 100644 --- a/tests/Aggregation/ReverseNestedAggregationTest.php +++ b/tests/Aggregation/ReverseNestedAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\ReverseNestedAggregation; +use ONGR\ElasticsearchDSL\Aggregation\ReverseNestedAggregation; class ReverseNestedAggregationTest extends \PHPUnit_Framework_TestCase { @@ -40,7 +40,7 @@ class ReverseNestedAggregationTest extends \PHPUnit_Framework_TestCase public function testToArray() { $termMock = $this - ->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Aggregation\TermsAggregation') + ->getMockBuilder('ONGR\ElasticsearchDSL\Aggregation\TermsAggregation') ->disableOriginalConstructor() ->getMock(); @@ -71,7 +71,7 @@ class ReverseNestedAggregationTest extends \PHPUnit_Framework_TestCase public function testToArrayNoPath() { $termMock = $this - ->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Aggregation\TermsAggregation') + ->getMockBuilder('ONGR\ElasticsearchDSL\Aggregation\TermsAggregation') ->disableOriginalConstructor() ->getMock(); diff --git a/tests/Aggregation/StatsAggregationTest.php b/tests/Aggregation/StatsAggregationTest.php index bbf0e56..621e0cf 100644 --- a/tests/Aggregation/StatsAggregationTest.php +++ b/tests/Aggregation/StatsAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\StatsAggregation; +use ONGR\ElasticsearchDSL\Aggregation\StatsAggregation; class StatsAggregationTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Aggregation/TermsAggregationTest.php b/tests/Aggregation/TermsAggregationTest.php index 14565d5..c96ebfe 100644 --- a/tests/Aggregation/TermsAggregationTest.php +++ b/tests/Aggregation/TermsAggregationTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\TermsAggregation; +use ONGR\ElasticsearchDSL\Aggregation\TermsAggregation; class TermsAggregationTest extends \PHPUnit_Framework_TestCase { @@ -57,7 +57,7 @@ class TermsAggregationTest extends \PHPUnit_Framework_TestCase // Case #2 terms aggregation with zero size. $aggregation = new TermsAggregation('test_agg'); $aggregation->setField('test_field'); - $aggregation->setSize(0); + $aggregation->addParameter('size', 0); $result = [ 'agg_test_agg' => [ diff --git a/tests/Aggregation/TopHitsAggregationTest.php b/tests/Aggregation/TopHitsAggregationTest.php index 743818d..a1975eb 100644 --- a/tests/Aggregation/TopHitsAggregationTest.php +++ b/tests/Aggregation/TopHitsAggregationTest.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Aggregation\TopHitsAggregation; -use ONGR\ElasticsearchBundle\DSL\Sort\Sorts; +use ONGR\ElasticsearchDSL\Aggregation\TopHitsAggregation; +use ONGR\ElasticsearchDSL\Sort\Sorts; /** * Unit tests for top hits aggregation. diff --git a/tests/Bool/BoolTest.php b/tests/Bool/BoolTest.php index 492dc38..521cd7f 100644 --- a/tests/Bool/BoolTest.php +++ b/tests/Bool/BoolTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Bool\Bool; -use ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter; -use ONGR\ElasticsearchBundle\DSL\Filter\TermFilter; +use ONGR\ElasticsearchDSL\Bool\Bool; +use ONGR\ElasticsearchDSL\Filter\MissingFilter; +use ONGR\ElasticsearchDSL\Filter\TermFilter; /** * Unit test for Bool. diff --git a/tests/DslTypeAwareTraitTest.php b/tests/DslTypeAwareTraitTest.php index 921620e..2b87d14 100644 --- a/tests/DslTypeAwareTraitTest.php +++ b/tests/DslTypeAwareTraitTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL; -use ONGR\ElasticsearchBundle\DSL\DslTypeAwareTrait; +use ONGR\ElasticsearchDSL\DslTypeAwareTrait; /** * Test for DslTypeAwareTrait. @@ -28,7 +28,7 @@ class DslTypeAwareTraitTest extends \PHPUnit_Framework_TestCase */ public function setUp() { - $this->mock = $this->getMockForTrait('ONGR\ElasticsearchBundle\DSL\DslTypeAwareTrait'); + $this->mock = $this->getMockForTrait('ONGR\ElasticsearchDSL\DslTypeAwareTrait'); } /** diff --git a/tests/Filter/AndFilterTest.php b/tests/Filter/AndFilterTest.php index a7fe515..b7c60ab 100644 --- a/tests/Filter/AndFilterTest.php +++ b/tests/Filter/AndFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\AndFilter; +use ONGR\ElasticsearchDSL\Filter\AndFilter; class AndFilterTest extends \PHPUnit_Framework_TestCase { @@ -32,7 +32,7 @@ class AndFilterTest extends \PHPUnit_Framework_TestCase */ public function getArrayDataProvider() { - $mockBuildeFfirstFilter = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface') + $mockBuildeFfirstFilter = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') ->getMock(); $mockBuildeFfirstFilter->expects($this->any()) ->method('getType') @@ -41,7 +41,7 @@ class AndFilterTest extends \PHPUnit_Framework_TestCase ->method('toArray') ->willReturn(['test_field' => ['test_value' => 'test']]); - $mockBuilderSecondFilter = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface') + $mockBuilderSecondFilter = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') ->getMock(); $mockBuilderSecondFilter->expects($this->any()) ->method('getType') diff --git a/tests/Filter/ExistsFilterTest.php b/tests/Filter/ExistsFilterTest.php index 69f85ba..76524c6 100644 --- a/tests/Filter/ExistsFilterTest.php +++ b/tests/Filter/ExistsFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\ExistsFilter; +use ONGR\ElasticsearchDSL\Filter\ExistsFilter; /** * Unit test for ExistsFilter. diff --git a/tests/Filter/GeoBoundingBoxFilterTest.php b/tests/Filter/GeoBoundingBoxFilterTest.php index e5164c2..6ab76b7 100644 --- a/tests/Filter/GeoBoundingBoxFilterTest.php +++ b/tests/Filter/GeoBoundingBoxFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\GeoBoundingBoxFilter; +use ONGR\ElasticsearchDSL\Filter\GeoBoundingBoxFilter; class GeoBoundingBoxFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/GeoDistanceFilterTest.php b/tests/Filter/GeoDistanceFilterTest.php index f506159..888ccbc 100644 --- a/tests/Filter/GeoDistanceFilterTest.php +++ b/tests/Filter/GeoDistanceFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\GeoDistanceFilter; +use ONGR\ElasticsearchDSL\Filter\GeoDistanceFilter; class GeoDistanceFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/GeoDistanceRangeFilterTest.php b/tests/Filter/GeoDistanceRangeFilterTest.php index a90c7c7..206d9d1 100644 --- a/tests/Filter/GeoDistanceRangeFilterTest.php +++ b/tests/Filter/GeoDistanceRangeFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\GeoDistanceRangeFilter; +use ONGR\ElasticsearchDSL\Filter\GeoDistanceRangeFilter; class GeoDistanceRangeFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/GeoPolygonFilterTest.php b/tests/Filter/GeoPolygonFilterTest.php index f24e1c1..bc0e8d5 100644 --- a/tests/Filter/GeoPolygonFilterTest.php +++ b/tests/Filter/GeoPolygonFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\GeoPolygonFilter; +use ONGR\ElasticsearchDSL\Filter\GeoPolygonFilter; class GeoPolygonFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/HasChildFilterTest.php b/tests/Filter/HasChildFilterTest.php index a4001c3..bfce344 100644 --- a/tests/Filter/HasChildFilterTest.php +++ b/tests/Filter/HasChildFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\HasChildFilter; +use ONGR\ElasticsearchDSL\Filter\HasChildFilter; class HasChildFilterTest extends \PHPUnit_Framework_TestCase { @@ -20,7 +20,7 @@ class HasChildFilterTest extends \PHPUnit_Framework_TestCase */ public function testGetType() { - $mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface')->getMock(); + $mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface')->getMock(); $filter = new HasChildFilter('test_field', $mock); $result = $filter->getType(); $this->assertEquals('has_child', $result); @@ -69,7 +69,7 @@ class HasChildFilterTest extends \PHPUnit_Framework_TestCase */ public function testToArray($type, $queryType, $queryToArray, $parameters, $dslType, $expected) { - $mockQuery = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface')->getMock(); + $mockQuery = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface')->getMock(); $mockQuery->expects($this->once()) ->method('getType') ->will($this->returnValue($queryType)); diff --git a/tests/Filter/HasParentFilterTest.php b/tests/Filter/HasParentFilterTest.php index 6f6c903..b08ed84 100644 --- a/tests/Filter/HasParentFilterTest.php +++ b/tests/Filter/HasParentFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\HasParentFilter; +use ONGR\ElasticsearchDSL\Filter\HasParentFilter; class HasParentFilterTest extends \PHPUnit_Framework_TestCase { @@ -20,7 +20,7 @@ class HasParentFilterTest extends \PHPUnit_Framework_TestCase */ public function testGetType() { - $mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface')->getMock(); + $mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface')->getMock(); $filter = new HasParentFilter('test_field', $mock); $result = $filter->getType(); $this->assertEquals('has_parent', $result); @@ -69,7 +69,7 @@ class HasParentFilterTest extends \PHPUnit_Framework_TestCase */ public function testToArray($parentType, $queryType, $queryToArray, $parameters, $dslType, $expected) { - $mockQuery = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface')->getMock(); + $mockQuery = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface')->getMock(); $mockQuery->expects($this->once()) ->method('getType') ->will($this->returnValue($queryType)); diff --git a/tests/Filter/IdsFilterTest.php b/tests/Filter/IdsFilterTest.php index e30a272..ca68d43 100644 --- a/tests/Filter/IdsFilterTest.php +++ b/tests/Filter/IdsFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\IdsFilter; +use ONGR\ElasticsearchDSL\Filter\IdsFilter; class IdsFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/IndicesFilterTest.php b/tests/Filter/IndicesFilterTest.php index 5034963..3afbffa 100644 --- a/tests/Filter/IndicesFilterTest.php +++ b/tests/Filter/IndicesFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\IndicesFilter; +use ONGR\ElasticsearchDSL\Filter\IndicesFilter; class IndicesFilterTest extends \PHPUnit_Framework_TestCase { @@ -94,7 +94,7 @@ class IndicesFilterTest extends \PHPUnit_Framework_TestCase */ private function indicesQtyMockBuilder(array $param = []) { - $mockBuilder = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface') + $mockBuilder = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') ->getMock(); $mockBuilder->expects($this->any()) ->method('getType') diff --git a/tests/Filter/LimitFilterTest.php b/tests/Filter/LimitFilterTest.php index 9d33e70..d60caf7 100644 --- a/tests/Filter/LimitFilterTest.php +++ b/tests/Filter/LimitFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\LimitFilter; +use ONGR\ElasticsearchDSL\Filter\LimitFilter; class LimitFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/MatchAllFilterTest.php b/tests/Filter/MatchAllFilterTest.php index 5e75aae..b1ff37f 100644 --- a/tests/Filter/MatchAllFilterTest.php +++ b/tests/Filter/MatchAllFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\MatchAllFilter; +use ONGR\ElasticsearchDSL\Filter\MatchAllFilter; class MatchAllFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/MissingFilterTest.php b/tests/Filter/MissingFilterTest.php index c11fced..65534a2 100644 --- a/tests/Filter/MissingFilterTest.php +++ b/tests/Filter/MissingFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter; +use ONGR\ElasticsearchDSL\Filter\MissingFilter; class MissingFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/NestedFilterTest.php b/tests/Filter/NestedFilterTest.php index 1e27ad8..b201973 100644 --- a/tests/Filter/NestedFilterTest.php +++ b/tests/Filter/NestedFilterTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\NestedFilter; -use ONGR\ElasticsearchBundle\DSL\Filter\TermFilter; -use ONGR\ElasticsearchBundle\DSL\Filter\TermsFilter; +use ONGR\ElasticsearchDSL\Filter\NestedFilter; +use ONGR\ElasticsearchDSL\Filter\TermFilter; +use ONGR\ElasticsearchDSL\Filter\TermsFilter; class NestedFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/NotFilterTest.php b/tests/Filter/NotFilterTest.php index 211bba1..409408c 100644 --- a/tests/Filter/NotFilterTest.php +++ b/tests/Filter/NotFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\NotFilter; +use ONGR\ElasticsearchDSL\Filter\NotFilter; class NotFilterTest extends \PHPUnit_Framework_TestCase { @@ -31,7 +31,7 @@ class NotFilterTest extends \PHPUnit_Framework_TestCase */ public function getArrayDataProvider() { - $mockBuilder = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface') + $mockBuilder = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') ->getMock(); $mockBuilder->expects($this->any()) ->method('getType') diff --git a/tests/Filter/OrFilterTest.php b/tests/Filter/OrFilterTest.php index 4e6e5fc..77c43a1 100644 --- a/tests/Filter/OrFilterTest.php +++ b/tests/Filter/OrFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\OrFilter; +use ONGR\ElasticsearchDSL\Filter\OrFilter; class OrFilterTest extends \PHPUnit_Framework_TestCase { @@ -32,7 +32,7 @@ class OrFilterTest extends \PHPUnit_Framework_TestCase */ public function getArrayDataProvider() { - $mockBuilderFirstFilter = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface') + $mockBuilderFirstFilter = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') ->getMock(); $mockBuilderFirstFilter->expects($this->any()) ->method('getType') @@ -41,7 +41,7 @@ class OrFilterTest extends \PHPUnit_Framework_TestCase ->method('toArray') ->willReturn(['test_field' => ['test_value' => 'test']]); - $mockBuilderSecondFilter = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface') + $mockBuilderSecondFilter = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') ->getMock(); $mockBuilderSecondFilter->expects($this->any()) ->method('getType') diff --git a/tests/Filter/PostFilterTest.php b/tests/Filter/PostFilterTest.php index 9b60ff1..ecc354d 100644 --- a/tests/Filter/PostFilterTest.php +++ b/tests/Filter/PostFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\PostFilter; +use ONGR\ElasticsearchDSL\Filter\PostFilter; class PostFilterTest extends \PHPUnit_Framework_TestCase { @@ -38,7 +38,7 @@ class PostFilterTest extends \PHPUnit_Framework_TestCase */ public function testAddFilter() { - $missingFilterMock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter') + $missingFilterMock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Filter\MissingFilter') ->disableOriginalConstructor() ->getMock(); $missingFilterMock diff --git a/tests/Filter/PrefixFilterTest.php b/tests/Filter/PrefixFilterTest.php index afd4651..2cf7613 100644 --- a/tests/Filter/PrefixFilterTest.php +++ b/tests/Filter/PrefixFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\PrefixFilter; +use ONGR\ElasticsearchDSL\Filter\PrefixFilter; class PrefixFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/QueryFilterTest.php b/tests/Filter/QueryFilterTest.php index 0a5909a..71608e9 100644 --- a/tests/Filter/QueryFilterTest.php +++ b/tests/Filter/QueryFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\QueryFilter; +use ONGR\ElasticsearchDSL\Filter\QueryFilter; class QueryFilterTest extends \PHPUnit_Framework_TestCase { @@ -20,7 +20,7 @@ class QueryFilterTest extends \PHPUnit_Framework_TestCase */ public function testToArrayWithGetTypeFqueryWithCache() { - $mockBuilder = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface') + $mockBuilder = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') ->getMock(); $mockBuilder->expects($this->any()) ->method('getType') @@ -36,7 +36,7 @@ class QueryFilterTest extends \PHPUnit_Framework_TestCase */ public function testToArrayWithGetTypeQueryWithoutCache() { - $mockBuilder = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface') + $mockBuilder = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') ->getMock(); $mockBuilder->expects($this->any()) ->method('getType') diff --git a/tests/Filter/RangeFilterTest.php b/tests/Filter/RangeFilterTest.php index 4214082..3c6589b 100644 --- a/tests/Filter/RangeFilterTest.php +++ b/tests/Filter/RangeFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\RangeFilter; +use ONGR\ElasticsearchDSL\Filter\RangeFilter; class RangeFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/RegexpFilterTest.php b/tests/Filter/RegexpFilterTest.php index b54eede..d0f3e91 100644 --- a/tests/Filter/RegexpFilterTest.php +++ b/tests/Filter/RegexpFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\RegexpFilter; +use ONGR\ElasticsearchDSL\Filter\RegexpFilter; class RegexpFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/ScriptFilterTest.php b/tests/Filter/ScriptFilterTest.php index bcbdf68..2125fb7 100644 --- a/tests/Filter/ScriptFilterTest.php +++ b/tests/Filter/ScriptFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\ScriptFilter; +use ONGR\ElasticsearchDSL\Filter\ScriptFilter; class ScriptFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/TermFilterTest.php b/tests/Filter/TermFilterTest.php index 11af22b..ec7f5f0 100644 --- a/tests/Filter/TermFilterTest.php +++ b/tests/Filter/TermFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\TermFilter; +use ONGR\ElasticsearchDSL\Filter\TermFilter; class TermFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/TermsFilterTest.php b/tests/Filter/TermsFilterTest.php index e9f7cdf..7f5a797 100644 --- a/tests/Filter/TermsFilterTest.php +++ b/tests/Filter/TermsFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\TermsFilter; +use ONGR\ElasticsearchDSL\Filter\TermsFilter; class TermsFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Filter/TypeFilterTest.php b/tests/Filter/TypeFilterTest.php index 99bbf0a..7ffb00c 100644 --- a/tests/Filter/TypeFilterTest.php +++ b/tests/Filter/TypeFilterTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Filter; -use ONGR\ElasticsearchBundle\DSL\Filter\TypeFilter; +use ONGR\ElasticsearchDSL\Filter\TypeFilter; class TypeFilterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Highlight/FieldTest.php b/tests/Highlight/FieldTest.php index 93c3cf9..26d5898 100644 --- a/tests/Highlight/FieldTest.php +++ b/tests/Highlight/FieldTest.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Highlight; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Highlight; -use ONGR\ElasticsearchBundle\DSL\Filter\TermFilter; -use ONGR\ElasticsearchBundle\DSL\Highlight\Field; +use ONGR\ElasticsearchDSL\Filter\TermFilter; +use ONGR\ElasticsearchDSL\Highlight\Field; /** * Unit test for Field. diff --git a/tests/Highlight/HighlightTest.php b/tests/Highlight/HighlightTest.php index 959f970..ae3bb15 100644 --- a/tests/Highlight/HighlightTest.php +++ b/tests/Highlight/HighlightTest.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Highlight; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Highlight; -use ONGR\ElasticsearchBundle\DSL\Highlight\Field; -use ONGR\ElasticsearchBundle\DSL\Highlight\Highlight; +use ONGR\ElasticsearchDSL\Highlight\Field; +use ONGR\ElasticsearchDSL\Highlight\Highlight; /** * Unit test for Highlight. diff --git a/tests/NamedBuilderBagTest.php b/tests/NamedBuilderBagTest.php index 9a0e98a..8dd7d98 100644 --- a/tests/NamedBuilderBagTest.php +++ b/tests/NamedBuilderBagTest.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL; -use ONGR\ElasticsearchBundle\DSL\NamedBuilderBag; -use ONGR\ElasticsearchBundle\DSL\NamedBuilderInterface; +use ONGR\ElasticsearchDSL\NamedBuilderBag; +use ONGR\ElasticsearchDSL\NamedBuilderInterface; class NamedBuilderBagTest extends \PHPUnit_Framework_TestCase { @@ -87,7 +87,7 @@ class NamedBuilderBagTest extends \PHPUnit_Framework_TestCase */ private function getBuilder($name) { - $friendlyBuilderMock = $this->getMock('ONGR\ElasticsearchBundle\DSL\NamedBuilderInterface'); + $friendlyBuilderMock = $this->getMock('ONGR\ElasticsearchDSL\NamedBuilderInterface'); $friendlyBuilderMock ->expects($this->once()) diff --git a/tests/ParametersTraitTest.php b/tests/ParametersTraitTest.php index 3b9507b..e5d3c9f 100644 --- a/tests/ParametersTraitTest.php +++ b/tests/ParametersTraitTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL; -use ONGR\ElasticsearchBundle\DSL\ParametersTrait; +use ONGR\ElasticsearchDSL\ParametersTrait; /** * Test for ParametersTrait. @@ -28,7 +28,7 @@ class ParametersTraitTest extends \PHPUnit_Framework_TestCase */ public function setUp() { - $this->parametersTraitMock = $this->getMockForTrait('ONGR\ElasticsearchBundle\DSL\ParametersTrait'); + $this->parametersTraitMock = $this->getMockForTrait('ONGR\ElasticsearchDSL\ParametersTrait'); } /** diff --git a/tests/Query/HasChildQueryTest.php b/tests/Query/HasChildQueryTest.php index 4fe6d82..a2f4205 100644 --- a/tests/Query/HasChildQueryTest.php +++ b/tests/Query/HasChildQueryTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query; -use ONGR\ElasticsearchBundle\DSL\Query\HasChildQuery; +use ONGR\ElasticsearchDSL\Query\HasChildQuery; class HasChildQueryTest extends \PHPUnit_Framework_TestCase { @@ -20,7 +20,7 @@ class HasChildQueryTest extends \PHPUnit_Framework_TestCase */ public function testConstructor() { - $missingFilterMock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter') + $missingFilterMock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Filter\MissingFilter') ->setConstructorArgs(['test_field']) ->getMock(); $query = new HasChildQuery('test_type', $missingFilterMock, ['test_parameter1']); diff --git a/tests/Query/HasParentQueryTest.php b/tests/Query/HasParentQueryTest.php index 57a8b77..6efcef5 100644 --- a/tests/Query/HasParentQueryTest.php +++ b/tests/Query/HasParentQueryTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query; -use ONGR\ElasticsearchBundle\DSL\Query\HasParentQuery; +use ONGR\ElasticsearchDSL\Query\HasParentQuery; class HasParentQueryTest extends \PHPUnit_Framework_TestCase { @@ -20,7 +20,7 @@ class HasParentQueryTest extends \PHPUnit_Framework_TestCase */ public function testConstructor() { - $missingFilter = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter') + $missingFilter = $this->getMockBuilder('ONGR\ElasticsearchDSL\Filter\MissingFilter') ->setConstructorArgs(['test_field']) ->getMock(); $query = new HasParentQuery('test_type', $missingFilter, ['test_parameter1']); diff --git a/tests/Query/IndicesQueryTest.php b/tests/Query/IndicesQueryTest.php index 1336653..3d12065 100644 --- a/tests/Query/IndicesQueryTest.php +++ b/tests/Query/IndicesQueryTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query; -use ONGR\ElasticsearchBundle\DSL\Query\FilteredQuery; -use ONGR\ElasticsearchBundle\DSL\Query\IndicesQuery; -use ONGR\ElasticsearchBundle\Test\EncapsulationTestAwareTrait; +use ONGR\ElasticsearchDSL\Query\FilteredQuery; +use ONGR\ElasticsearchDSL\Query\IndicesQuery; +use ONGR\ElasticsearchDSL\Test\EncapsulationTestAwareTrait; class IndicesQueryTest extends \PHPUnit_Framework_TestCase { @@ -24,7 +24,7 @@ class IndicesQueryTest extends \PHPUnit_Framework_TestCase */ public function getArrayWithManyIndicesDataProvider() { - $queryMock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Query\Query') + $queryMock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Query\Query') ->getMock(); $queryMock->expects($this->any()) ->method('toArray') diff --git a/tests/Query/NestedQueryTest.php b/tests/Query/NestedQueryTest.php index 545df36..4b51d9d 100644 --- a/tests/Query/NestedQueryTest.php +++ b/tests/Query/NestedQueryTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query; -use ONGR\ElasticsearchBundle\DSL\Query\NestedQuery; +use ONGR\ElasticsearchDSL\Query\NestedQuery; class NestedQueryTest extends \PHPUnit_Framework_TestCase { @@ -20,7 +20,7 @@ class NestedQueryTest extends \PHPUnit_Framework_TestCase */ public function testToArray() { - $missingFilterMock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter') + $missingFilterMock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Filter\MissingFilter') ->setConstructorArgs(['test_field']) ->getMock(); $missingFilterMock->expects($this->any()) diff --git a/tests/Query/QueryTest.php b/tests/Query/QueryTest.php index e2ffd57..c27a031 100644 --- a/tests/Query/QueryTest.php +++ b/tests/Query/QueryTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query; -use ONGR\ElasticsearchBundle\DSL\Query\Query; +use ONGR\ElasticsearchDSL\Query\Query; class QueryTest extends \PHPUnit_Framework_TestCase { @@ -20,7 +20,7 @@ class QueryTest extends \PHPUnit_Framework_TestCase */ public function testSetBoolParameters() { - $missingFilterMock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter') + $missingFilterMock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Filter\MissingFilter') ->setConstructorArgs(['test_field']) ->getMock(); $missingFilterMock->expects($this->once()) @@ -37,7 +37,7 @@ class QueryTest extends \PHPUnit_Framework_TestCase public function testAddQuery() { $missingFilterMock = $this - ->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter') + ->getMockBuilder('ONGR\ElasticsearchDSL\Filter\MissingFilter') ->disableOriginalConstructor() ->setMethods(['add']) ->getMock(); @@ -46,7 +46,7 @@ class QueryTest extends \PHPUnit_Framework_TestCase ->method('add') ->withAnyParameters(); $postFilterMock = $this - ->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Filter\PostFilter') + ->getMockBuilder('ONGR\ElasticsearchDSL\Filter\PostFilter') ->disableOriginalConstructor() ->getMock(); @@ -69,7 +69,7 @@ class QueryTest extends \PHPUnit_Framework_TestCase */ public function testToArray() { - $missingFilterMock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter') + $missingFilterMock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Filter\MissingFilter') ->disableOriginalConstructor() ->getMock(); $missingFilterMock->expects($this->once()) diff --git a/tests/Query/Span/SpanFirstQueryTest.php b/tests/Query/Span/SpanFirstQueryTest.php index 9b1e4d1..7dbb30a 100644 --- a/tests/Query/Span/SpanFirstQueryTest.php +++ b/tests/Query/Span/SpanFirstQueryTest.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query\Span; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query\Span; -use ONGR\ElasticsearchBundle\DSL\Query\Span\SpanFirstQuery; -use ONGR\ElasticsearchBundle\DSL\Query\Span\SpanQueryInterface; +use ONGR\ElasticsearchDSL\Query\Span\SpanFirstQuery; +use ONGR\ElasticsearchDSL\Query\Span\SpanQueryInterface; /** * Unit test for SpanFirstQuery. @@ -29,7 +29,7 @@ class SpanFirstQueryTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Query\Span\SpanQueryInterface')->getMock(); + $this->mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Query\Span\SpanQueryInterface')->getMock(); $this->mock->expects($this->atMost(1)) ->method('getType') ->will($this->returnValue('span_or')); diff --git a/tests/Query/Span/SpanMultiTermQueryTest.php b/tests/Query/Span/SpanMultiTermQueryTest.php index dbbfe4e..3852861 100644 --- a/tests/Query/Span/SpanMultiTermQueryTest.php +++ b/tests/Query/Span/SpanMultiTermQueryTest.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query\Span; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query\Span; -use ONGR\ElasticsearchBundle\DSL\BuilderInterface; -use ONGR\ElasticsearchBundle\DSL\Query\Span\SpanMultiTermQuery; +use ONGR\ElasticsearchDSL\BuilderInterface; +use ONGR\ElasticsearchDSL\Query\Span\SpanMultiTermQuery; /** * Unit test for SpanMultiTermQuery. @@ -32,7 +32,7 @@ class SpanMultiTermQueryTest extends \PHPUnit_Framework_TestCase $allowedQueries = ['\FuzzyQuery', '\PrefixQuery', '\TermQuery', '\WildcardQuery', '\RegexpQuery']; // Same constructors for all of these queries. foreach ($allowedQueries as $query) { - $this->mock[$query] = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Query' . "{$query}") + $this->mock[$query] = $this->getMockBuilder('ONGR\ElasticsearchDSL\Query' . "{$query}") ->setConstructorArgs(['field', 'value']) ->getMock(); $this->mock[$query]->expects($this->atMost(1)) @@ -79,7 +79,7 @@ class SpanMultiTermQueryTest extends \PHPUnit_Framework_TestCase public function testSpanMultiTermQueryToArrayNext() { /** @var BuilderInterface $mock */ - $mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Query\RangeQuery') + $mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Query\RangeQuery') ->setConstructorArgs(['field', ['gte']]) ->getMock(); $mock->expects($this->once()) diff --git a/tests/Query/Span/SpanNearQueryTest.php b/tests/Query/Span/SpanNearQueryTest.php index ebdcfbc..23b254c 100644 --- a/tests/Query/Span/SpanNearQueryTest.php +++ b/tests/Query/Span/SpanNearQueryTest.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query\Span; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query\Span; -use ONGR\ElasticsearchBundle\DSL\Query\Span\SpanNearQuery; -use ONGR\ElasticsearchBundle\DSL\Query\Span\SpanQueryInterface; +use ONGR\ElasticsearchDSL\Query\Span\SpanNearQuery; +use ONGR\ElasticsearchDSL\Query\Span\SpanQueryInterface; /** * Unit test for SpanNearQuery. @@ -29,7 +29,7 @@ class SpanNearQueryTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Query\Span\SpanQueryInterface')->getMock(); + $this->mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Query\Span\SpanQueryInterface')->getMock(); $this->mock->expects($this->atMost(1)) ->method('getType') ->will($this->returnValue('span_or')); diff --git a/tests/Query/Span/SpanNotQueryTest.php b/tests/Query/Span/SpanNotQueryTest.php index df6856a..4f0afdf 100644 --- a/tests/Query/Span/SpanNotQueryTest.php +++ b/tests/Query/Span/SpanNotQueryTest.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query\Span; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query\Span; -use ONGR\ElasticsearchBundle\DSL\Query\Span\SpanNotQuery; -use ONGR\ElasticsearchBundle\DSL\Query\Span\SpanQueryInterface; +use ONGR\ElasticsearchDSL\Query\Span\SpanNotQuery; +use ONGR\ElasticsearchDSL\Query\Span\SpanQueryInterface; /** * Unit test for SpanNotQuery. @@ -29,7 +29,7 @@ class SpanNotQueryTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Query\Span\SpanQueryInterface')->getMock(); + $this->mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Query\Span\SpanQueryInterface')->getMock(); $this->mock->expects($this->atMost(2)) ->method('getType') ->will($this->returnValue('span_or')); diff --git a/tests/Query/Span/SpanOrQueryTest.php b/tests/Query/Span/SpanOrQueryTest.php index 5e4b1fe..b9eead5 100644 --- a/tests/Query/Span/SpanOrQueryTest.php +++ b/tests/Query/Span/SpanOrQueryTest.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query\Span; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query\Span; -use ONGR\ElasticsearchBundle\DSL\Query\Span\SpanOrQuery; -use ONGR\ElasticsearchBundle\DSL\Query\Span\SpanQueryInterface; +use ONGR\ElasticsearchDSL\Query\Span\SpanOrQuery; +use ONGR\ElasticsearchDSL\Query\Span\SpanQueryInterface; /** * Unit test for SpanOrQuery. @@ -29,7 +29,7 @@ class SpanOrQueryTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\Query\Span\SpanQueryInterface')->getMock(); + $this->mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Query\Span\SpanQueryInterface')->getMock(); $this->mock->expects($this->atMost(1)) ->method('getType') ->will($this->returnValue('span_or')); diff --git a/tests/Query/Span/SpanTermQueryTest.php b/tests/Query/Span/SpanTermQueryTest.php index 1af7971..537f862 100644 --- a/tests/Query/Span/SpanTermQueryTest.php +++ b/tests/Query/Span/SpanTermQueryTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Query\Span; +namespace ONGR\ElasticsearchDSL\Tests\Unit\DSL\Query\Span; -use ONGR\ElasticsearchBundle\DSL\Query\Span\SpanTermQuery; +use ONGR\ElasticsearchDSL\Query\Span\SpanTermQuery; /** * Unit test for SpanTermQuery. diff --git a/tests/SearchEndpoint/SearchEndpointFactoryTest.php b/tests/SearchEndpoint/SearchEndpointFactoryTest.php index eeaee16..5f62d23 100644 --- a/tests/SearchEndpoint/SearchEndpointFactoryTest.php +++ b/tests/SearchEndpoint/SearchEndpointFactoryTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ONGR\ElasticsearchBundle\Tests\Unit\SearchEndpoint; +namespace ONGR\ElasticsearchDSL\Tests\Unit\SearchEndpoint; -use ONGR\ElasticsearchBundle\DSL\SearchEndpoint\SearchEndpointFactory; +use ONGR\ElasticsearchDSL\SearchEndpoint\SearchEndpointFactory; /** * Unit test class for search endpoint factory. diff --git a/tests/Suggester/CompletionTest.php b/tests/Suggester/CompletionTest.php deleted file mode 100644 index 973d8e0..0000000 --- a/tests/Suggester/CompletionTest.php +++ /dev/null @@ -1,153 +0,0 @@ -<?php - -/* - * This file is part of the ONGR package. - * - * (c) NFQ Technologies UAB <info@nfq.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Suggester; - -use ONGR\ElasticsearchBundle\DSL\Suggester\Completion; -use ONGR\ElasticsearchBundle\Test\EncapsulationTestAwareTrait; - -class CompletionTest extends \PHPUnit_Framework_TestCase -{ - use EncapsulationTestAwareTrait; - - /** - * @return array - */ - public function getTestToArrayData() - { - $out = []; - - // Case #0: simple. - $completion0 = new Completion('my-field', 'lorem ipsum'); - $expected0 = [ - 'my-field-completion' => [ - 'text' => 'lorem ipsum', - 'completion' => ['field' => 'my-field'], - ], - ]; - - $out[] = [ - $expected0, - $completion0, - ]; - - // Case #1: using fuzzy. - $completion1 = new Completion('my-other-field', 'super awesome cat', 'my-completion1'); - $completion1->useFuzzy(true); - $expected1 = [ - 'my-completion1' => [ - 'text' => 'super awesome cat', - 'completion' => [ - 'field' => 'my-other-field', - 'fuzzy' => true, - ], - ], - ]; - - $out[] = [ - $expected1, - $completion1, - ]; - - // Case #2: providing all data. - $completion2 = new Completion('body', 'even more super awesome cat', 'my-completion2'); - $completion2 - ->setFuzziness(2) - ->setMinLength(3) - ->setPrefixLength(1) - ->setTranspositions(true) - ->setUnicodeAware(''); - - $expected2 = [ - 'my-completion2' => [ - 'text' => 'even more super awesome cat', - 'completion' => [ - 'field' => 'body', - 'fuzzy' => [ - 'fuzziness' => 2, - 'transpositions' => true, - 'min_length' => 3, - 'prefix_length' => 1, - ], - ], - ], - ]; - - $out[] = [ - $expected2, - $completion2, - ]; - - return $out; - } - - /** - * Tests toArray method. - * - * @param array $expected - * @param Completion $completion - * - * @dataProvider getTestToArrayData - */ - public function testToArray($expected, $completion) - { - $this->assertEquals($expected, $completion->toArray()); - } - - /** - * Tests if toArray method throws Logic Exception. - * - * @expectedException \LogicException - */ - public function testToArrayException() - { - $completion = new Completion('foo', 'bar'); - $completion->setField(null); - $completion->setText(null); - $completion->toArray(); - } - - /** - * Tests useFuzzy property. - */ - public function testUseFuzzy() - { - $completion = new Completion('foo', 'bar'); - $completion->useFuzzy(true); - $this->assertEquals(true, $completion->isFuzzy()); - } - - /** - * @return string - */ - public function getClassName() - { - $this->setStub(new Completion('foo', 'bar')); - $this->addIgnoredField('useFuzzy'); - - return 'ONGR\ElasticsearchBundle\DSL\Suggester\Completion'; - } - - /** - * @return array - */ - public function getFieldsData() - { - return [ - ['name'], - ['fuzziness'], - ['transpositions', 'boolean'], - ['minLength'], - ['prefixLength'], - ['unicodeAware'], - ]; - } -} diff --git a/tests/Suggester/Context/CategoryContextTest.php b/tests/Suggester/Context/CategoryContextTest.php deleted file mode 100644 index e5567cd..0000000 --- a/tests/Suggester/Context/CategoryContextTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/* - * This file is part of the ONGR package. - * - * (c) NFQ Technologies UAB <info@nfq.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Suggester\Context; - -use ONGR\ElasticsearchBundle\DSL\Suggester\Context\CategoryContext; -use ONGR\ElasticsearchBundle\Test\EncapsulationTestAwareTrait; - -class CategoryContextTest extends \PHPUnit_Framework_TestCase -{ - use EncapsulationTestAwareTrait; - - /** - * @return string - */ - public function getClassName() - { - $this->setStub(new CategoryContext('foo', 'bar')); - - return 'ONGR\ElasticsearchBundle\DSL\Suggester\Context\CategoryContext'; - } - - /** - * @return array - */ - public function getFieldsData() - { - return [ - ['name'], - ['value'], - ]; - } -} diff --git a/tests/Suggester/Context/GeoContextTest.php b/tests/Suggester/Context/GeoContextTest.php deleted file mode 100644 index 8a8a918..0000000 --- a/tests/Suggester/Context/GeoContextTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/* - * This file is part of the ONGR package. - * - * (c) NFQ Technologies UAB <info@nfq.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Suggester\Context; - -use ONGR\ElasticsearchBundle\DSL\Suggester\Context\CategoryContext; -use ONGR\ElasticsearchBundle\DSL\Suggester\Context\GeoContext; -use ONGR\ElasticsearchBundle\Test\EncapsulationTestAwareTrait; - -class GeoContextTest extends \PHPUnit_Framework_TestCase -{ - use EncapsulationTestAwareTrait; - - /** - * @return string - */ - public function getClassName() - { - $this->setStub(new GeoContext('foo', 'bar')); - - return 'ONGR\ElasticsearchBundle\DSL\Suggester\Context\GeoContext'; - } - - /** - * @return array - */ - public function getFieldsData() - { - return [ - ['precision'], - ['name'], - ['value'], - ]; - } -} diff --git a/tests/Suggester/ContextTest.php b/tests/Suggester/ContextTest.php deleted file mode 100644 index 363a368..0000000 --- a/tests/Suggester/ContextTest.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -/* - * This file is part of the ONGR package. - * - * (c) NFQ Technologies UAB <info@nfq.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Suggester; - -use ONGR\ElasticsearchBundle\DSL\Suggester\Completion; -use ONGR\ElasticsearchBundle\DSL\Suggester\Context; -use ONGR\ElasticsearchBundle\DSL\Suggester\Phrase; -use ONGR\ElasticsearchBundle\Test\EncapsulationTestAwareTrait; - -class ContextTest extends \PHPUnit_Framework_TestCase -{ - use EncapsulationTestAwareTrait; - - /** - * Tests toArray method when $this->getSize() !== null. - */ - public function testToArrayNotNull() - { - $name = 'testName'; - - $context = new Context('', '', $name); - $context->setSize(123); - $context->setContext(new Phrase('', '')); - - $result = $context->toArray(); - $this->assertArrayHasKey($name, $result); - - $data = $result[$name]; - $this->assertArrayHasKey('completion', $data); - - $completion = $data['completion']; - $this->assertArrayHasKey('size', $completion); - $this->assertEquals($completion['size'], 123); - } - - /** - * Returns list of fields to test. Works as data provider. - * - * @return array - */ - public function getFieldsData() - { - return [ - ['context'], - ['size'], - ]; - } - - /** - * Returns entity class name. - * - * @return string - */ - public function getClassName() - { - $this->setStub(new Context('foo', 'bar')); - - return 'ONGR\ElasticsearchBundle\DSL\Suggester\Context'; - } -} diff --git a/tests/Suggester/PhraseTest.php b/tests/Suggester/PhraseTest.php deleted file mode 100644 index 946bcee..0000000 --- a/tests/Suggester/PhraseTest.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php - -/* - * This file is part of the ONGR package. - * - * (c) NFQ Technologies UAB <info@nfq.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Suggester; - -use ONGR\ElasticsearchBundle\DSL\Suggester\Phrase; -use ONGR\ElasticsearchBundle\Test\EncapsulationTestAwareTrait; - -class PhraseTest extends \PHPUnit_Framework_TestCase -{ - use EncapsulationTestAwareTrait; - - /** - * @return array - */ - public function getTestToArrayData() - { - $out = []; - - // Case #0: simple. - $phrase0 = new Phrase('body', 'lorem ipsum'); - $expected0 = [ - 'body-phrase' => [ - 'text' => 'lorem ipsum', - 'phrase' => ['field' => 'body'], - ], - ]; - - $out[] = [ - $expected0, - $phrase0, - ]; - - // Case #1: using all fields. - $phrase1 = new Phrase('description', 'awesome cat'); - $phrase1->setMaxErrors(2); - $phrase1->setGramSize(1); - $phrase1->setRealWordErrorLikelihood(0.95); - $phrase1->setHighlight(['pre_tag' => '<span class="info">', 'post_tag' => '</span>']); - $phrase1->setAnalyzer('simple'); - $phrase1->setConfidence(1); - $phrase1->setSize(6); - - $highlightObject = new \stdClass(); - $highlightObject->post_tag = '</span>'; - $highlightObject->pre_tag = '<span class="info">'; - - $expected1 = [ - 'description-phrase' => [ - 'text' => 'awesome cat', - 'phrase' => [ - 'analyzer' => 'simple', - 'field' => 'description', - 'size' => 6, - 'real_word_error_likelihood' => 0.95, - 'max_errors' => 2.0, - 'gram_size' => 1, - 'highlight' => $highlightObject, - ], - ], - ]; - - $out[] = [ - $expected1, - $phrase1, - ]; - - return $out; - } - - /** - * Tests toArray method. - * - * @param array $expected - * @param Phrase $phrase - * - * @dataProvider getTestToArrayData - */ - public function testToArray($expected, $phrase) - { - $this->assertEquals($expected, $phrase->toArray()); - } - - /** - * Tests toArray method exception. - * - * @expectedException \LogicException - */ - public function testToArrayException() - { - $phrase = new Phrase('', ''); - $phrase->toArray(); - } - - /** - * @return string - */ - public function getClassName() - { - $this->setStub(new Phrase('foo', 'bar')); - - return 'ONGR\ElasticsearchBundle\DSL\Suggester\Phrase'; - } - - /** - * Returns list of fields to test. Works as data provider. - * - * @return array - */ - public function getFieldsData() - { - return [ - ['analyzer'], - ['gramSize'], - ['realWordErrorLikelihood'], - ['confidence'], - ['maxErrors'], - ['highlight'], - ['size'], - ]; - } -} diff --git a/tests/Suggester/TermTest.php b/tests/Suggester/TermTest.php deleted file mode 100644 index c0ec281..0000000 --- a/tests/Suggester/TermTest.php +++ /dev/null @@ -1,156 +0,0 @@ -<?php - -/* - * This file is part of the ONGR package. - * - * (c) NFQ Technologies UAB <info@nfq.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Suggester; - -use ONGR\ElasticsearchBundle\DSL\Suggester\Term; -use ONGR\ElasticsearchBundle\Test\EncapsulationTestAwareTrait; - -class TermTest extends \PHPUnit_Framework_TestCase -{ - use EncapsulationTestAwareTrait; - - /** - * @return array - */ - public function getTestToArrayData() - { - $out = []; - - // Case #0: simple. - $term0 = new Term('body', 'lorem ipsum'); - $expected0 = [ - 'body-term' => [ - 'text' => 'lorem ipsum', - 'term' => ['field' => 'body'], - ], - ]; - $out[] = [ - $expected0, - $term0, - ]; - - // Case #1: full suggester. - $term1 = new Term('body', 'lorem ipsum'); - $term1 - ->setSize(2) - ->setAnalyzer('simple') - ->setSuggestMode(Term::SUGGEST_MODE_ALWAYS) - ->setSort(Term::SORT_BY_SCORE); - - $expected1 = [ - 'body-term' => [ - 'text' => 'lorem ipsum', - 'term' => [ - 'field' => 'body', - 'analyzer' => 'simple', - 'sort' => 'score', - 'suggest_mode' => 'always', - ], - 'size' => 2, - ], - ]; - - $out[] = [ - $expected1, - $term1, - ]; - - return $out; - } - - /** - * Tests toArray method. - * - * @param array $expected - * @param Term $suggester - * - * @dataProvider getTestToArrayData - */ - public function testToArray($expected, $suggester) - { - $this->assertEquals($expected, $suggester->toArray()); - } - - /** - * Tests toArray method exception. - * - * @expectedException \LogicException - */ - public function testToArrayException() - { - $term = new Term('', ''); - $term->toArray(); - } - - /** - * Tests setSort method. - */ - public function testSetSort() - { - $term = new Term('foo', 'bar'); - - $term->setSort(Term::SORT_BY_FREQ); - $this->assertEquals(Term::SORT_BY_FREQ, $term->getSort()); - - $term->setSort(Term::SORT_BY_SCORE); - $this->assertEquals(Term::SORT_BY_SCORE, $term->getSort()); - - $initValue = $term->getSort(); - $term->setSort('wrongSort'); - $this->assertEquals($initValue, $term->getSort()); - } - - /** - * Tests setSuggestMode method. - */ - public function testSetSuggestMode() - { - $term = new Term('foo', 'bar'); - - $term->setSuggestMode(Term::SUGGEST_MODE_ALWAYS); - $this->assertEquals(Term::SUGGEST_MODE_ALWAYS, $term->getSuggestMode()); - - $term->setSuggestMode(Term::SUGGEST_MODE_MISSING); - $this->assertEquals(Term::SUGGEST_MODE_MISSING, $term->getSuggestMode()); - - $initValue = $term->getSuggestMode(); - $term->setSuggestMode('wrongMode'); - $this->assertEquals($initValue, $term->getSuggestMode()); - } - - /** - * Returns list of fields to test. Works as data provider. - * - * @return array - */ - public function getFieldsData() - { - return [ - ['analyzer'], - ['size'], - ]; - } - - /** - * Returns entity class name. - * - * @return string - */ - public function getClassName() - { - $this->setStub(new Term('foo', 'bar')); - $this->addIgnoredField('sort'); - $this->addIgnoredField('suggestMode'); - - return 'ONGR\ElasticsearchBundle\DSL\Suggester\Term'; - } -} -- GitLab