You are here

protected function SimpleXmlTest::assertResults in Migrate Plus 8.5

Same name and namespace in other branches
  1. 8.4 tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php \Drupal\Tests\migrate_plus\Kernel\Plugin\migrate_plus\data_parser\SimpleXmlTest::assertResults()

Parses and asserts the results match expectations.

Parameters

array|string $expected: The expected results.

\Traversable $parser: An iterable data result to parse.

3 calls to SimpleXmlTest::assertResults()
SimpleXmlTest::testReadNonStandardXml2 in tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php
Test reading non standard conforming XML .
SimpleXmlTest::testReadNonStandardXmlWhitespace in tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php
Test reading non standard conforming XML.
SimpleXmlTest::testReduceSingleValue in tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php
Tests reducing single values.

File

tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php, line 194

Class

SimpleXmlTest
Test of the data_parser SimpleXml migrate_plus plugin.

Namespace

Drupal\Tests\migrate_plus\Kernel\Plugin\migrate_plus\data_parser

Code

protected function assertResults($expected, \Traversable $parser) {
  $data = [];
  foreach ($parser as $item) {
    $values = [];
    foreach ($item['values'] as $value) {
      $values[] = (string) $value;
    }
    $data[] = $values;
  }
  $this
    ->assertEquals($expected, $data);
}