11<?php
22
3+ declare (strict_types=1 );
4+
5+ /*
6+ * Copyright MacFJA
7+ *
8+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
9+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
10+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
11+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
12+ *
13+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
14+ * Software.
15+ *
16+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
17+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+ */
21+
322namespace Tests \MacFJA \RediSearch \Search \QueryBuilder ;
423
524use MacFJA \RediSearch \Search \QueryBuilder \NumericFacet ;
625use PHPUnit \Framework \TestCase ;
726
827/**
928 * @coversDefaultClass \MacFJA\RediSearch\Search\QueryBuilder\NumericFacet
29+ * @covers ::render
30+ *
31+ * @uses \MacFJA\RediSearch\Helper\EscapeHelper
32+ * @uses \MacFJA\RediSearch\Search\QueryBuilder\NumericFacet
1033 *
1134 * @see: https://oss.redislabs.com/redisearch/Query_Syntax/#mapping_common_sql_predicates_to_redisearch
1235 * WHERE num BETWEEN 10 AND 20 @num:[10 20]
@@ -24,7 +47,7 @@ class NumericFacetTest extends TestCase
2447 public function testGreaterThan ()
2548 {
2649 $ facet = NumericFacet::greaterThan ('num ' , 10 );
27- $ this -> assertSame ('@num:[(10 +inf] ' , $ facet ->render ());
50+ self :: assertSame ('@num:[(10 +inf] ' , $ facet ->render ());
2851 }
2952
3053 /**
@@ -33,7 +56,7 @@ public function testGreaterThan()
3356 public function testGreaterThanOrEquals ()
3457 {
3558 $ facet = NumericFacet::greaterThanOrEquals ('num ' , 10 );
36- $ this -> assertSame ('@num:[10 +inf] ' , $ facet ->render ());
59+ self :: assertSame ('@num:[10 +inf] ' , $ facet ->render ());
3760 }
3861
3962 /**
@@ -42,7 +65,7 @@ public function testGreaterThanOrEquals()
4265 public function testLessThan ()
4366 {
4467 $ facet = NumericFacet::lessThan ('num ' , 10 );
45- $ this -> assertSame ('@num:[-inf (10] ' , $ facet ->render ());
68+ self :: assertSame ('@num:[-inf (10] ' , $ facet ->render ());
4669 }
4770
4871 /**
@@ -51,7 +74,7 @@ public function testLessThan()
5174 public function testLessThanOrEquals ()
5275 {
5376 $ facet = NumericFacet::lessThanOrEquals ('num ' , 10 );
54- $ this -> assertSame ('@num:[-inf 10] ' , $ facet ->render ());
77+ self :: assertSame ('@num:[-inf 10] ' , $ facet ->render ());
5578 }
5679
5780 /**
@@ -60,6 +83,6 @@ public function testLessThanOrEquals()
6083 public function testEqualsTo ()
6184 {
6285 $ facet = NumericFacet::equalsTo ('num ' , 10 );
63- $ this -> assertSame ('@num:[10 10] ' , $ facet ->render ());
86+ self :: assertSame ('@num:[10 10] ' , $ facet ->render ());
6487 }
6588}
0 commit comments