class VersionTest
Same name and namespace in other branches
- 11.x core/modules/ckeditor5/tests/src/Unit/VersionTest.php \Drupal\Tests\ckeditor5\Unit\VersionTest
- 11.x core/modules/system/tests/src/Functional/Module/VersionTest.php \Drupal\Tests\system\Functional\Module\VersionTest
Tests module version dependencies.
@group Module
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\Module\ModuleTestBase implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\system\Functional\Module\VersionTest implements \Drupal\Tests\system\Functional\Module\ModuleTestBase
- class \Drupal\Tests\system\Functional\Module\ModuleTestBase implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of VersionTest
File
-
core/
modules/ system/ tests/ src/ Functional/ Module/ VersionTest.php, line 10
Namespace
Drupal\Tests\system\Functional\ModuleView source
class VersionTest extends ModuleTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests version dependencies.
*/
public function testModuleVersions() {
$dependencies = [
// Alternating between being compatible and incompatible with 8.x-2.4-beta3.
// The first is always a compatible.
'common_test',
// Branch incompatibility.
'common_test (1.x)',
// Branch compatibility.
'common_test (2.x)',
// Another branch incompatibility.
'common_test (>2.x)',
// Another branch compatibility.
'common_test (<=2.x)',
// Another branch incompatibility.
'common_test (<2.x)',
// Another branch compatibility.
'common_test (>=2.x)',
// Nonsense, misses a dash. Incompatible with everything.
'common_test (=8.x2.x, >=2.4)',
// Core version is optional. Compatible.
'common_test (=8.x-2.x, >=2.4-alpha2)',
// Test !=, explicitly incompatible.
'common_test (=2.x, !=2.4-beta3)',
// Three operations. Compatible.
'common_test (=2.x, !=2.3, <2.5)',
// Testing extra version. Incompatible.
'common_test (<=2.4-beta2)',
// Testing extra version. Compatible.
'common_test (>2.4-beta2)',
// Testing extra version. Incompatible.
'common_test (>2.4-rc0)',
];
\Drupal::state()->set('system_test.dependencies', $dependencies);
$n = count($dependencies);
for ($i = 0; $i < $n; $i++) {
$this->drupalGet('admin/modules');
if ($i % 2 == 0) {
$this->assertSession()
->fieldEnabled('edit-modules-module-test-enable');
}
else {
$this->assertSession()
->fieldDisabled('edit-modules-module-test-enable');
}
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.