Skip to content
Snippets Groups Projects
Commit de1b5392 authored by LTRocky's avatar LTRocky
Browse files

Test DSL/Filter

parent a39d1da2
No related branches found
No related tags found
No related merge requests found
<?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);
}
}
<?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);
}
}
<?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);
}
}
<?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);
}
}
<?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);
}
}
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Aggregation; 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; use ONGR\ElasticsearchBundle\DSL\Highlight\Field;
/** /**
......
...@@ -98,8 +98,6 @@ class PhraseTest extends \PHPUnit_Framework_TestCase ...@@ -98,8 +98,6 @@ class PhraseTest extends \PHPUnit_Framework_TestCase
{ {
$phrase = new Phrase('', ''); $phrase = new Phrase('', '');
$phrase->toArray(); $phrase->toArray();
$this->getFieldsData();
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment