You are here

public function SocialTest::testSocial in Open Social 8.4

Same name and namespace in other branches
  1. 8.9 src/Tests/SocialTest.php \Drupal\social\Tests\SocialTest::testSocial()
  2. 8 src/Tests/SocialTest.php \Drupal\social\Tests\SocialTest::testSocial()
  3. 8.2 src/Tests/SocialTest.php \Drupal\social\Tests\SocialTest::testSocial()
  4. 8.3 src/Tests/SocialTest.php \Drupal\social\Tests\SocialTest::testSocial()
  5. 8.5 src/Tests/SocialTest.php \Drupal\social\Tests\SocialTest::testSocial()
  6. 8.6 src/Tests/SocialTest.php \Drupal\social\Tests\SocialTest::testSocial()
  7. 8.7 src/Tests/SocialTest.php \Drupal\social\Tests\SocialTest::testSocial()
  8. 8.8 src/Tests/SocialTest.php \Drupal\social\Tests\SocialTest::testSocial()

Tests Social installation profile.

File

src/Tests/SocialTest.php, line 19

Class

SocialTest
Tests Social installation profile expectations.

Namespace

Drupal\social\Tests

Code

public function testSocial() {
  $this
    ->drupalGet('');

  // Check the login block is present.
  $this
    ->assertLink(t('Create new account'));
  $this
    ->assertResponse(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
    ->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.');
}