update 1.0.8.0
Commits for version update
This commit is contained in:
50
vendor/mtdowling/jmespath.php/tests/ParserTest.php
vendored
Normal file
50
vendor/mtdowling/jmespath.php/tests/ParserTest.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace JmesPath\Tests;
|
||||
|
||||
use JmesPath\Lexer;
|
||||
use JmesPath\Parser;
|
||||
|
||||
/**
|
||||
* @covers JmesPath\Parser
|
||||
*/
|
||||
class ParserTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException \JmesPath\SyntaxErrorException
|
||||
* @expectedExceptionMessage Syntax error at character 0
|
||||
*/
|
||||
public function testMatchesFirstTokens()
|
||||
{
|
||||
$p = new Parser(new Lexer());
|
||||
$p->parse('.bar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \JmesPath\SyntaxErrorException
|
||||
* @expectedExceptionMessage Syntax error at character 1
|
||||
*/
|
||||
public function testThrowsSyntaxErrorForInvalidSequence()
|
||||
{
|
||||
$p = new Parser(new Lexer());
|
||||
$p->parse('a,');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \JmesPath\SyntaxErrorException
|
||||
* @expectedExceptionMessage Syntax error at character 2
|
||||
*/
|
||||
public function testMatchesAfterFirstToken()
|
||||
{
|
||||
$p = new Parser(new Lexer());
|
||||
$p->parse('a.,');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \JmesPath\SyntaxErrorException
|
||||
* @expectedExceptionMessage Unexpected "eof" token
|
||||
*/
|
||||
public function testHandlesEmptyExpressions()
|
||||
{
|
||||
(new Parser(new Lexer()))->parse('');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user