function SchemaCompatibilityCheckerTest::testIsCompatible

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Theme/Component/SchemaCompatibilityCheckerTest.php \Drupal\Tests\Core\Theme\Component\SchemaCompatibilityCheckerTest::testIsCompatible()

@covers ::isCompatible
@dataProvider dataProviderIsCompatible

File

core/tests/Drupal/Tests/Core/Theme/Component/SchemaCompatibilityCheckerTest.php, line 34

Class

SchemaCompatibilityCheckerTest
@coversDefaultClass \Drupal\Core\Theme\Component\SchemaCompatibilityChecker[[api-linebreak]] @group sdc

Namespace

Drupal\Tests\Core\Theme\Component

Code

public function testIsCompatible(array $first_schema, array $second_schema, bool $expected) : void {
  try {
    $this->checker
      ->isCompatible($first_schema, $second_schema);
    $is_compatible = TRUE;
  } catch (IncompatibleComponentSchema $e) {
    $is_compatible = FALSE;
  }
  $this->assertSame($expected, $is_compatible);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.