DrupalCheckIncompatibilityTest.php in Drupal 8
File
core/tests/Drupal/KernelTests/Core/Common/DrupalCheckIncompatibilityTest.php
View source
<?php
namespace Drupal\KernelTests\Core\Common;
use Drupal\Core\Extension\Dependency;
use Drupal\KernelTests\KernelTestBase;
class DrupalCheckIncompatibilityTest extends KernelTestBase {
public function testDrupalCheckIncompatibility($version_info, $version_to_check, $result) {
$this
->assertSame($result, drupal_check_incompatibility($version_info, $version_to_check));
}
public function providerDrupalCheckIncompatibility() {
$module_data = [
'name' => 'views_ui',
'original_version' => ' (8.x-1.0)',
'versions' => [
[
'op' => '=',
'version' => '1.0',
],
],
];
$data = [];
$data['is compatible'] = [
$module_data,
'1.0',
NULL,
];
$data['not compatible'] = [
$module_data,
'1.1',
' (8.x-1.0)',
];
$dependency = new Dependency('views', 'drupal', '8.x-1.2');
$data['dependency object'] = [
$dependency,
'1.1',
' (8.x-1.2)',
];
return $data;
}
}