You are here

protected function LinkFieldSerializerTest::assertArraySubsetWrapper in Acquia Content Hub 8.2

Wrapper class that asserts that an array has a specified subset.

@todo When Drupal 9/PHPUnit 9 is standard, this method can be removed and the tests need to be refactored to use the DMSAssertArraySubset library.

@codeCoverageIgnore

Parameters

array|ArrayAccess $subset: Subset for assertion.

array|ArrayAccess $array: Array for assertion.

bool $checkForObjectIdentity: Boolean to check for object identity.

string $message: Message used for assertion.

Throws

\Exception

1 call to LinkFieldSerializerTest::assertArraySubsetWrapper()
LinkFieldSerializerTest::testOnSerializeContentFieldMultiLang in tests/src/Kernel/EventSubscriber/SerializeContentField/LinkFieldSerializerTest.php
@covers ::onSerializeContentField

File

tests/src/Kernel/EventSubscriber/SerializeContentField/LinkFieldSerializerTest.php, line 130

Class

LinkFieldSerializerTest
Tests Link Field Serialization.

Namespace

Drupal\Tests\acquia_contenthub\Kernel\EventSubscriber\SerializeContentField

Code

protected function assertArraySubsetWrapper($subset, $array, bool $checkForObjectIdentity = FALSE, string $message = '') : void {
  if (class_exists(DMSAssert::class)) {
    DMSAssert::assertArraySubset($subset, $array, $checkForObjectIdentity, $message);
  }
  else {
    $this
      ->assertArraySubset($subset, $array, $checkForObjectIdentity, $message);
  }
}