You are here

protected function MigrateTestCase::retrievalAssertHelper in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/tests/src/Unit/MigrateTestCase.php \Drupal\Tests\migrate\Unit\MigrateTestCase::retrievalAssertHelper()

Asserts tested values during test retrieval.

Parameters

mixed $expected_value: The incoming expected value to test.

mixed $actual_value: The incoming value itself.

string $message: The tested result as a formatted string.

1 call to MigrateTestCase::retrievalAssertHelper()
MigrateTestCase::queryResultTest in core/modules/migrate/tests/src/Unit/MigrateTestCase.php
Tests a query

File

core/modules/migrate/tests/src/Unit/MigrateTestCase.php, line 189
Contains \Drupal\Tests\migrate\Unit\MigrateTestCase.

Class

MigrateTestCase
Provides setup and helper methods for Migrate module tests.

Namespace

Drupal\Tests\migrate\Unit

Code

protected function retrievalAssertHelper($expected_value, $actual_value, $message) {
  if (is_array($expected_value)) {
    foreach ($expected_value as $k => $v) {
      $this
        ->retrievalAssertHelper($v, $actual_value[$k], $message . '[' . $k . ']');
    }
  }
  else {
    $this
      ->assertSame((string) $expected_value, (string) $actual_value, $message);
  }
}