MinimalTest.php 1.89 KB
Newer Older
1
2
<?php

3
namespace Drupal\Tests\minimal\Functional;
4

5
use Drupal\Tests\BrowserTestBase;
6
use Drupal\Tests\RequirementsPageTrait;
7
use Drupal\user\UserInterface;
8
9
10

/**
 * Tests Minimal installation profile expectations.
11
12
 *
 * @group minimal
13
 */
14
class MinimalTest extends BrowserTestBase {
15

16
17
  use RequirementsPageTrait;

18
19
  protected $profile = 'minimal';

20
21
22
23
24
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

25
26
27
  /**
   * Tests Minimal installation profile.
   */
28
  public function testMinimal() {
29
30
    $this->drupalGet('');
    // Check the login block is present.
31
    $this->assertSession()->linkExists(t('Create new account'));
32
    $this->assertSession()->statusCodeEquals(200);
33
34
35

    // Create a user to test tools and navigation blocks for logged in users
    // with appropriate permissions.
36
37
38
39
    $user = $this->drupalCreateUser([
      'access administration pages',
      'administer content types',
    ]);
40
41
42
43
    $this->drupalLogin($user);
    $this->drupalGet('');
    $this->assertText(t('Tools'));
    $this->assertText(t('Administration'));
44
45
46
47

    // Ensure that there are no pending updates after installation.
    $this->drupalLogin($this->rootUser);
    $this->drupalGet('update.php/selection');
48
49
    $this->updateRequirementsProblem();
    $this->drupalGet('update.php/selection');
50
    $this->assertText('No pending updates.');
51
52
53

    // 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.');
54
55
56

    // 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.');
57
    $this->assertEquals(UserInterface::REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL, $this->config('user.settings')->get('register'));
58
  }
59

60
}