You are here

public function FeedsExXmlUnitTests::testValidateExpression in Feeds extensible parsers 7.2

Tests XPath validation.

File

src/Tests/FeedsExXml.test, line 191
Contains tests for FeedsExXml.

Class

FeedsExXmlUnitTests
Unit tests for FeedsExXml.

Code

public function testValidateExpression() {

  // Invalid expression.
  $parser = FeedsConfigurable::instance('FeedsExXml', 'test_parser');
  $expression = array(
    '!!',
  );
  $this
    ->assertEqual('Invalid expression', $this
    ->invokeMethod($parser, 'validateExpression', $expression));

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

  // Unknown namespace.
  $this
    ->assertEqual(NULL, $this
    ->invokeMethod($parser, 'validateExpression', array(
    'thing:asdf',
  )));

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