You are here

public function JsonPathParserTest::testValidateExpression in Feeds extensible parsers 8

Tests JSONPath validation.

File

tests/src/Unit/Feeds/Parser/JsonPathParserTest.php, line 138

Class

JsonPathParserTest
@coversDefaultClass \Drupal\feeds_ex\Feeds\Parser\JsonPathParser @group feeds_ex

Namespace

Drupal\Tests\feeds_ex\Unit\Feeds\Parser

Code

public function testValidateExpression() {

  // Invalid expression.
  $expression = '!! ';
  $this
    ->assertStringStartsWith('Unable to parse token !! in expression', $this
    ->invokeMethod($this->parser, 'validateExpression', [
    &$expression,
  ]));

  // Test that value was trimmed.
  $this
    ->assertSame($expression, '!!', 'Value was trimmed.');
}