diff options
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/NumericRangeTest.php')
-rw-r--r-- | vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/NumericRangeTest.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/NumericRangeTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/NumericRangeTest.php new file mode 100644 index 00000000..590b5137 --- /dev/null +++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/NumericRangeTest.php @@ -0,0 +1,37 @@ +<?php +namespace Elastica\Test\Filter; + +use Elastica\Filter\NumericRange; +use Elastica\Test\Base as BaseTest; + +class NumericRangeTest extends BaseTest +{ + /** + * @group unit + */ + public function testAddField() + { + $rangeFilter = new NumericRange(); + $returnValue = $rangeFilter->addField('fieldName', array('to' => 'value')); + $this->assertInstanceOf('Elastica\Filter\NumericRange', $returnValue); + } + + /** + * @group unit + */ + public function testToArray() + { + $filter = new NumericRange(); + + $fromTo = array('from' => 'ra', 'to' => 'ru'); + $filter->addField('name', $fromTo); + + $expectedArray = array( + 'numeric_range' => array( + 'name' => $fromTo, + ), + ); + + $this->assertEquals($expectedArray, $filter->toArray()); + } +} |