You are here

public function FeedsExQueryPathXmlUnitTests::testValidateExpression in Feeds extensible parsers 7.2

Tests QueryPath validation.

File

src/Tests/FeedsExQueryPathXml.test, line 223
Contains tests for FeedsExQueryPathXml.

Class

FeedsExQueryPathXmlUnitTests
Unit tests for FeedsExQueryPathXml.

Code

public function testValidateExpression() {

  // Invalid expression.
  $parser = FeedsConfigurable::instance('FeedsExQueryPathXml', 'test_parser');
  $expression = array(
    '!!',
  );
  $this
    ->assertEqual('CSS selector is not well formed.', $this
    ->invokeMethod($parser, 'validateExpression', $expression));

  // Test that value was trimmed.
  $this
    ->assertEqual($expression[0], '!!', 'Value was trimmed.');

  // Empty.
  $this
    ->assertEqual(NULL, $this
    ->invokeMethod($parser, 'validateExpression', array(
    '',
  )));
}