diff --git a/Filter/GeoDistanceFilterTest.php b/Filter/GeoDistanceFilterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ef47d6741ef01e02baf9fbced57075c86241cdc2 --- /dev/null +++ b/Filter/GeoDistanceFilterTest.php @@ -0,0 +1,27 @@ +<?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\Filter; + +use ONGR\ElasticsearchBundle\DSL\Filter\GeoDistanceFilter; + +class GeoDistanceFilterTest extends \PHPUnit_Framework_TestCase +{ + /** + * Tests GetType method. + */ + public function testGetType() + { + $filter = new GeoDistanceFilter('test_field', 'test_distance', 'test_location'); + $result = $filter->getType(); + $this->assertEquals('geo_distance', $result); + } +} diff --git a/Filter/GeoDistanceRangeFilterTest.php b/Filter/GeoDistanceRangeFilterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..dc28570bd49aa3dae869b95b71a0816a156afebd --- /dev/null +++ b/Filter/GeoDistanceRangeFilterTest.php @@ -0,0 +1,27 @@ +<?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\Filter; + +use ONGR\ElasticsearchBundle\DSL\Filter\GeoDistanceRangeFilter; + +class GeoDistanceRangeFilterTest extends \PHPUnit_Framework_TestCase +{ + /** + * Tests GetType method. + */ + public function testGetType() + { + $filter = new GeoDistanceRangeFilter('test_field', 'test_distance', 'test_location'); + $result = $filter->getType(); + $this->assertEquals('geo_distance_range', $result); + } +} diff --git a/Filter/GeoPolygonFilterTest.php b/Filter/GeoPolygonFilterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..1eae928c245a787783b7137913755c826642e03d --- /dev/null +++ b/Filter/GeoPolygonFilterTest.php @@ -0,0 +1,27 @@ +<?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\Filter; + +use ONGR\ElasticsearchBundle\DSL\Filter\GeoPolygonFilter; + +class GeoPolygonFilterTest extends \PHPUnit_Framework_TestCase +{ + /** + * Tests GetType method. + */ + public function testGetType() + { + $filter = new GeoPolygonFilter('test_field'); + $result = $filter->getType(); + $this->assertEquals('geo_polygon', $result); + } +} diff --git a/Filter/HasChildFilterTest.php b/Filter/HasChildFilterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b0312b7a8fcbef8c472f5066187a9d08b1e58dee --- /dev/null +++ b/Filter/HasChildFilterTest.php @@ -0,0 +1,28 @@ +<?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\Filter; + +use ONGR\ElasticsearchBundle\DSL\Filter\HasChildFilter; + +class HasChildFilterTest extends \PHPUnit_Framework_TestCase +{ + /** + * Tests GetType method. + */ + public function testGetType() + { + $mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface')->getMock(); + $filter = new HasChildFilter('test_field', $mock); + $result = $filter->getType(); + $this->assertEquals('has_child', $result); + } +} diff --git a/Filter/HasParentFilterTest.php b/Filter/HasParentFilterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b33f1cc7921027e984eac366061afa8d6e894a0a --- /dev/null +++ b/Filter/HasParentFilterTest.php @@ -0,0 +1,28 @@ +<?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\Filter; + +use ONGR\ElasticsearchBundle\DSL\Filter\HasParentFilter; + +class HasParentFilterTest extends \PHPUnit_Framework_TestCase +{ + /** + * Tests GetType method. + */ + public function testGetType() + { + $mock = $this->getMockBuilder('ONGR\ElasticsearchBundle\DSL\BuilderInterface')->getMock(); + $filter = new HasParentFilter('test_field', $mock); + $result = $filter->getType(); + $this->assertEquals('has_parent', $result); + } +} diff --git a/Highlight/FieldTest.php b/Highlight/FieldTest.php index df3f071afbb759825a379723de5e1257454aa0da..8961ca27e8200b329db915607860af722b7181e2 100644 --- a/Highlight/FieldTest.php +++ b/Highlight/FieldTest.php @@ -11,8 +11,6 @@ namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; -use ONGR\ElasticsearchBundle\DSL\Bool\Bool; -use ONGR\ElasticsearchBundle\DSL\Filter\MissingFilter; use ONGR\ElasticsearchBundle\DSL\Highlight\Field; /** diff --git a/Suggester/PhraseTest.php b/Suggester/PhraseTest.php index bef3d3d75be99d06a20ea451918af875034376c7..946bcee0b880448a6e330b26ed3b396220685668 100644 --- a/Suggester/PhraseTest.php +++ b/Suggester/PhraseTest.php @@ -98,8 +98,6 @@ class PhraseTest extends \PHPUnit_Framework_TestCase { $phrase = new Phrase('', ''); $phrase->toArray(); - - $this->getFieldsData(); } /**