You are here

public function XmlParserTraitTest::test in Feeds 8.3

Basic XML parsing test.

File

tests/src/Unit/Component/XmlParserTraitTest.php, line 16

Class

XmlParserTraitTest
@coversDefaultClass \Drupal\feeds\Component\XmlParserTrait @group feeds

Namespace

Drupal\Tests\feeds\Unit\Component

Code

public function test() {
  $trait = $this
    ->getMockForTrait('Drupal\\feeds\\Component\\XmlParserTrait');
  $doc = $this
    ->callProtectedMethod($trait, 'getDomDocument', [
    ' <thing></thing> ',
  ]);
  $this
    ->assertSame('DOMDocument', get_class($doc));
  $errors = $this
    ->callProtectedMethod($trait, 'getXmlErrors');
  $this
    ->assertSame([], $errors);
}