protected function UpdateTestBase::assertCoreVersion in Automatic Updates 8.2
Asserts that a specific version of Drupal core is running.
Assumes that a user with permission to view the status report is logged in.
Parameters
string $expected_version: The version of core that should be running.
2 calls to UpdateTestBase::assertCoreVersion()
- CoreUpdateTest::assertUpdateSuccessful in tests/
src/ Build/ CoreUpdateTest.php - Asserts that Drupal core was successfully updated.
- CoreUpdateTest::createTestSite in tests/
src/ Build/ CoreUpdateTest.php - Uses our already-installed dependencies to build a test site to update.
File
- tests/
src/ Build/ UpdateTestBase.php, line 249
Class
- UpdateTestBase
- Base class for tests that perform in-place updates.
Namespace
Drupal\Tests\automatic_updates\BuildCode
protected function assertCoreVersion(string $expected_version) : void {
$this
->visit('/admin/reports/status');
$item = $this
->getMink()
->assertSession()
->elementExists('css', 'h3:contains("Drupal Version")')
->getParent()
->getText();
$this
->assertStringContainsString($expected_version, $item);
}