class MinimalTest
Same name and namespace in other branches
- 10 core/profiles/minimal/tests/src/Functional/MinimalTest.php \Drupal\Tests\minimal\Functional\MinimalTest
- 11.x core/profiles/minimal/tests/src/Functional/MinimalTest.php \Drupal\Tests\minimal\Functional\MinimalTest
- 9 core/profiles/minimal/tests/src/Functional/MinimalTest.php \Drupal\Tests\minimal\Functional\MinimalTest
Tests Minimal installation profile expectations.
@group minimal
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\PhpunitCompatibilityTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\minimal\Functional\MinimalTest uses \Drupal\Tests\RequirementsPageTrait extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of MinimalTest
File
-
core/
profiles/ minimal/ tests/ src/ Functional/ MinimalTest.php, line 14
Namespace
Drupal\Tests\minimal\FunctionalView source
class MinimalTest extends BrowserTestBase {
use RequirementsPageTrait;
protected $profile = 'minimal';
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests Minimal installation profile.
*/
public function testMinimal() {
$this->drupalGet('');
// Check the login block is present.
$this->assertSession()
->linkExists(t('Create new account'));
$this->assertSession()
->statusCodeEquals(200);
// Create a user to test tools and navigation blocks for logged in users
// with appropriate permissions.
$user = $this->drupalCreateUser([
'access administration pages',
'administer content types',
]);
$this->drupalLogin($user);
$this->drupalGet('');
$this->assertText(t('Tools'));
$this->assertText(t('Administration'));
// Ensure that there are no pending updates after installation.
$this->drupalLogin($this->rootUser);
$this->drupalGet('update.php/selection');
$this->updateRequirementsProblem();
$this->drupalGet('update.php/selection');
$this->assertText('No pending updates.');
// Ensure that there are no pending entity updates after installation.
$this->assertFalse($this->container
->get('entity.definition_update_manager')
->needsUpdates(), 'After installation, entity schema is up to date.');
// Ensure special configuration overrides are correct.
$this->assertFalse($this->config('system.theme.global')
->get('features.node_user_picture'), 'Configuration system.theme.global:features.node_user_picture is FALSE.');
$this->assertEquals(UserInterface::REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL, $this->config('user.settings')
->get('register'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.