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()
  2. 10 core/tests/Drupal/Tests/Core/Theme/Component/SchemaCompatibilityCheckerTest.php \Drupal\Tests\Core\Theme\Component\SchemaCompatibilityCheckerTest::testIsCompatible()

Tests is compatible.

Attributes

#[DataProvider('dataProviderIsCompatible')]

File

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

Class

SchemaCompatibilityCheckerTest
Tests Drupal\Core\Theme\Component\SchemaCompatibilityChecker.

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) {
    $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.