@@ -19,7 +19,27 @@ class JSONPathLexerTest extends TestCase
1919 /**
2020 * @throws JSONPathException
2121 */
22- public function test_Index_Wildcard (): void
22+ public function testEmptyExpression (): void
23+ {
24+ $ tokens = (new JSONPathLexer ('' ))->parseExpression ();
25+
26+ self ::assertEmpty ($ tokens );
27+ }
28+
29+ /**
30+ * @throws JSONPathException
31+ */
32+ public function testDollarOnlyExpression (): void
33+ {
34+ $ tokens = (new JSONPathLexer ('$ ' ))->parseExpression ();
35+
36+ self ::assertEmpty ($ tokens );
37+ }
38+
39+ /**
40+ * @throws JSONPathException
41+ */
42+ public function testIndexWildcard (): void
2343 {
2444 $ tokens = (new JSONPathLexer ('.* ' ))->parseExpression ();
2545
@@ -30,7 +50,7 @@ public function test_Index_Wildcard(): void
3050 /**
3151 * @throws JSONPathException
3252 */
33- public function test_Index_Simple (): void
53+ public function testIndexSimple (): void
3454 {
3555 $ tokens = (new JSONPathLexer ('.foo ' ))->parseExpression ();
3656
@@ -41,7 +61,7 @@ public function test_Index_Simple(): void
4161 /**
4262 * @throws JSONPathException
4363 */
44- public function test_Index_Recursive (): void
64+ public function testIndexRecursive (): void
4565 {
4666 $ tokens = (new JSONPathLexer ('..teams.* ' ))->parseExpression ();
4767
@@ -57,7 +77,7 @@ public function test_Index_Recursive(): void
5777 /**
5878 * @throws JSONPathException
5979 */
60- public function test_Index_Complex (): void
80+ public function testIndexComplex (): void
6181 {
6282 $ tokens = (new JSONPathLexer ('[" \'b.^*_"] ' ))->parseExpression ();
6383
@@ -68,7 +88,7 @@ public function test_Index_Complex(): void
6888 /**
6989 * @throws JSONPathException
7090 */
71- public function test_Index_BadlyFormed (): void
91+ public function testIndexBadlyFormed (): void
7292 {
7393 $ this ->expectException (JSONPathException::class);
7494 $ this ->expectExceptionMessage ('Unable to parse token hello* in expression: .hello* ' );
@@ -79,7 +99,7 @@ public function test_Index_BadlyFormed(): void
7999 /**
80100 * @throws JSONPathException
81101 */
82- public function test_Index_Integer (): void
102+ public function testIndexInteger (): void
83103 {
84104 $ tokens = (new JSONPathLexer ('[0] ' ))->parseExpression ();
85105
@@ -90,7 +110,7 @@ public function test_Index_Integer(): void
90110 /**
91111 * @throws JSONPathException
92112 */
93- public function test_Index_IntegerAfterDotNotation (): void
113+ public function testIndexIntegerAfterDotNotation (): void
94114 {
95115 $ tokens = (new JSONPathLexer ('.books[0] ' ))->parseExpression ();
96116
@@ -103,7 +123,7 @@ public function test_Index_IntegerAfterDotNotation(): void
103123 /**
104124 * @throws JSONPathException
105125 */
106- public function test_Index_Word (): void
126+ public function testIndexWord (): void
107127 {
108128 $ tokens = (new JSONPathLexer ('["foo$-/ \'"] ' ))->parseExpression ();
109129
@@ -114,7 +134,7 @@ public function test_Index_Word(): void
114134 /**
115135 * @throws JSONPathException
116136 */
117- public function test_Index_WordWithWhitespace (): void
137+ public function testIndexWordWithWhitespace (): void
118138 {
119139 $ tokens = (new JSONPathLexer ('[ "foo$-/ \'" ] ' ))->parseExpression ();
120140
@@ -125,7 +145,7 @@ public function test_Index_WordWithWhitespace(): void
125145 /**
126146 * @throws JSONPathException
127147 */
128- public function test_Slice_Simple (): void
148+ public function testSliceSimple (): void
129149 {
130150 $ tokens = (new JSONPathLexer ('[0:1:2] ' ))->parseExpression ();
131151
@@ -136,7 +156,7 @@ public function test_Slice_Simple(): void
136156 /**
137157 * @throws JSONPathException
138158 */
139- public function test_Index_NegativeIndex (): void
159+ public function testIndexNegativeIndex (): void
140160 {
141161 $ tokens = (new JSONPathLexer ('[-1] ' ))->parseExpression ();
142162
@@ -147,7 +167,7 @@ public function test_Index_NegativeIndex(): void
147167 /**
148168 * @throws JSONPathException
149169 */
150- public function test_Slice_AllNull (): void
170+ public function testSliceAllNull (): void
151171 {
152172 $ tokens = (new JSONPathLexer ('[:] ' ))->parseExpression ();
153173
@@ -158,7 +178,7 @@ public function test_Slice_AllNull(): void
158178 /**
159179 * @throws JSONPathException
160180 */
161- public function test_QueryResult_Simple (): void
181+ public function testQueryResultSimple (): void
162182 {
163183 $ tokens = (new JSONPathLexer ('[(@.foo + 2)] ' ))->parseExpression ();
164184
@@ -169,7 +189,7 @@ public function test_QueryResult_Simple(): void
169189 /**
170190 * @throws JSONPathException
171191 */
172- public function test_QueryMatch_Simple (): void
192+ public function testQueryMatchSimple (): void
173193 {
174194 $ tokens = (new JSONPathLexer ('[?(@.foo < \'bar \')] ' ))->parseExpression ();
175195
@@ -180,7 +200,7 @@ public function test_QueryMatch_Simple(): void
180200 /**
181201 * @throws JSONPathException
182202 */
183- public function test_QueryMatch_NotEqualTO (): void
203+ public function testQueryMatchNotEqualTO (): void
184204 {
185205 $ tokens = (new JSONPathLexer ('[?(@.foo != \'bar \')] ' ))->parseExpression ();
186206
@@ -191,7 +211,7 @@ public function test_QueryMatch_NotEqualTO(): void
191211 /**
192212 * @throws JSONPathException
193213 */
194- public function test_QueryMatch_Brackets (): void
214+ public function testQueryMatchBrackets (): void
195215 {
196216 $ tokens = (new JSONPathLexer ("[?(@['@language']='en')] " ))->parseExpression ();
197217
@@ -203,7 +223,7 @@ public function test_QueryMatch_Brackets(): void
203223 /**
204224 * @throws JSONPathException
205225 */
206- public function test_Recursive_Simple (): void
226+ public function testRecursiveSimple (): void
207227 {
208228 $ tokens = (new JSONPathLexer ('..foo ' ))->parseExpression ();
209229
@@ -216,7 +236,7 @@ public function test_Recursive_Simple(): void
216236 /**
217237 * @throws JSONPathException
218238 */
219- public function test_Recursive_Wildcard (): void
239+ public function testRecursiveWildcard (): void
220240 {
221241 $ tokens = (new JSONPathLexer ('..* ' ))->parseExpression ();
222242
@@ -229,7 +249,7 @@ public function test_Recursive_Wildcard(): void
229249 /**
230250 * @throws JSONPathException
231251 */
232- public function test_Recursive_BadlyFormed (): void
252+ public function testRecursiveBadlyFormed (): void
233253 {
234254 $ this ->expectException (JSONPathException::class);
235255 $ this ->expectExceptionMessage ('Unable to parse token ba^r in expression: ..ba^r ' );
@@ -240,7 +260,7 @@ public function test_Recursive_BadlyFormed(): void
240260 /**
241261 * @throws JSONPathException
242262 */
243- public function test_Indexes_Simple (): void
263+ public function testIndexesSimple (): void
244264 {
245265 $ tokens = (new JSONPathLexer ('[1,2,3] ' ))->parseExpression ();
246266
@@ -251,7 +271,7 @@ public function test_Indexes_Simple(): void
251271 /**
252272 * @throws JSONPathException
253273 */
254- public function test_Indexes_Whitespace (): void
274+ public function testIndexesWhitespace (): void
255275 {
256276 $ tokens = (new JSONPathLexer ('[ 1,2 , 3] ' ))->parseExpression ();
257277
0 commit comments