function ProjectCoreCompatibilityTest::testIsCoreCompatible
Same name and namespace in other branches
- 10 core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php \Drupal\Tests\update\Unit\ProjectCoreCompatibilityTest::testIsCoreCompatible()
@covers ::isCoreCompatible @dataProvider providerIsCoreCompatible
Parameters
string $constraint: The core_version_constraint to test.
string $installed_core: The installed version of core to compare against.
bool $expected: The expected result.
File
-
core/
modules/ update/ tests/ src/ Unit/ ProjectCoreCompatibilityTest.php, line 170
Class
- ProjectCoreCompatibilityTest
- @coversDefaultClass <a href="/api/drupal/core%21modules%21update%21src%21ProjectCoreCompatibility.php/class/ProjectCoreCompatibility/11.x" title="Utility class to set core compatibility messages for project releases." class="local">\Drupal\update\ProjectCoreCompatibility</a>
Namespace
Drupal\Tests\update\UnitCode
public function testIsCoreCompatible(string $constraint, string $installed_core, bool $expected) : void {
$core_data['existing_version'] = $installed_core;
$project_compatibility = new ProjectCoreCompatibility($core_data, [], []);
$reflection = new \ReflectionClass(ProjectCoreCompatibility::class);
$reflection_method = $reflection->getMethod('isCoreCompatible');
$result = $reflection_method->invokeArgs($project_compatibility, [
$constraint,
]);
$this->assertSame($expected, $result);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.