1
1
<?php
2
2
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
+
3
22
namespace Tests \MacFJA \RediSearch \Search \QueryBuilder ;
4
23
5
24
use MacFJA \RediSearch \Search \QueryBuilder \NumericFacet ;
6
25
use PHPUnit \Framework \TestCase ;
7
26
8
27
/**
9
28
* @coversDefaultClass \MacFJA\RediSearch\Search\QueryBuilder\NumericFacet
29
+ * @covers ::render
30
+ *
31
+ * @uses \MacFJA\RediSearch\Helper\EscapeHelper
32
+ * @uses \MacFJA\RediSearch\Search\QueryBuilder\NumericFacet
10
33
*
11
34
* @see: https://oss.redislabs.com/redisearch/Query_Syntax/#mapping_common_sql_predicates_to_redisearch
12
35
* WHERE num BETWEEN 10 AND 20 @num:[10 20]
@@ -24,7 +47,7 @@ class NumericFacetTest extends TestCase
24
47
public function testGreaterThan ()
25
48
{
26
49
$ facet = NumericFacet::greaterThan ('num ' , 10 );
27
- $ this -> assertSame ('@num:[(10 +inf] ' , $ facet ->render ());
50
+ self :: assertSame ('@num:[(10 +inf] ' , $ facet ->render ());
28
51
}
29
52
30
53
/**
@@ -33,7 +56,7 @@ public function testGreaterThan()
33
56
public function testGreaterThanOrEquals ()
34
57
{
35
58
$ facet = NumericFacet::greaterThanOrEquals ('num ' , 10 );
36
- $ this -> assertSame ('@num:[10 +inf] ' , $ facet ->render ());
59
+ self :: assertSame ('@num:[10 +inf] ' , $ facet ->render ());
37
60
}
38
61
39
62
/**
@@ -42,7 +65,7 @@ public function testGreaterThanOrEquals()
42
65
public function testLessThan ()
43
66
{
44
67
$ facet = NumericFacet::lessThan ('num ' , 10 );
45
- $ this -> assertSame ('@num:[-inf (10] ' , $ facet ->render ());
68
+ self :: assertSame ('@num:[-inf (10] ' , $ facet ->render ());
46
69
}
47
70
48
71
/**
@@ -51,7 +74,7 @@ public function testLessThan()
51
74
public function testLessThanOrEquals ()
52
75
{
53
76
$ facet = NumericFacet::lessThanOrEquals ('num ' , 10 );
54
- $ this -> assertSame ('@num:[-inf 10] ' , $ facet ->render ());
77
+ self :: assertSame ('@num:[-inf 10] ' , $ facet ->render ());
55
78
}
56
79
57
80
/**
@@ -60,6 +83,6 @@ public function testLessThanOrEquals()
60
83
public function testEqualsTo ()
61
84
{
62
85
$ facet = NumericFacet::equalsTo ('num ' , 10 );
63
- $ this -> assertSame ('@num:[10 10] ' , $ facet ->render ());
86
+ self :: assertSame ('@num:[10 10] ' , $ facet ->render ());
64
87
}
65
88
}
0 commit comments