Skip to content
Snippets Groups Projects
Commit 83d2e025 authored by Martynas Sudintas's avatar Martynas Sudintas
Browse files

fixed ExistsFilter tests

parent cdb4bbdf
No related branches found
No related tags found
No related merge requests found
......@@ -13,24 +13,26 @@ namespace ONGR\ElasticsearchBundle\Tests\Unit\DSL\Filter;
use ONGR\ElasticsearchBundle\DSL\Filter\ExistsFilter;
/**
* Unit test for ExistsFilter.
*/
class ExistsFilterTest extends \PHPUnit_Framework_TestCase
{
/**
* Tests GetType method.
* Tests ExistsFilter#getType() method.
*/
public function testGetType()
{
$filter = new ExistsFilter('foo', 'bar');
$filter = new ExistsFilter('bar');
$this->assertEquals('exists', $filter->getType());
}
/**
* Test for filter toArray() method.
* Tests ExistsFilter#toArray() method.
*/
public function testToArray()
{
$filter = new ExistsFilter('foo', 'bar');
$expectedResult = ['foo' => 'bar'];
$this->assertEquals($expectedResult, $filter->toArray());
$filter = new ExistsFilter('bar');
$this->assertEquals(['field' => 'bar'], $filter->toArray());
}
}
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