You are here

protected function ContentHubMultilingualSettingsWebhookTest::setUp in Acquia Content Hub 8.2

Overrides BrowserTestBase::setUp

File

tests/src/Functional/ContentHubMultilingualSettingsWebhookTest.php, line 42

Class

ContentHubMultilingualSettingsWebhookTest
Tests that the Webhook Url is unchanged with multilingual settings.

Namespace

Drupal\Tests\acquia_contenthub\Functional

Code

protected function setUp() {
  parent::setUp();

  // User to manage languages.
  $this->authorizedUser = $this
    ->drupalCreateUser([], NULL, TRUE);
  $this
    ->drupalLogin($this->authorizedUser);

  // Adding French Language: FR.
  ConfigurableLanguage::createFromLangcode('fr')
    ->save();

  // Set language detection to url.
  $this
    ->drupalPostForm('/admin/config/regional/language/detection', [
    'language_interface[enabled][language-url]' => TRUE,
    'language_interface[enabled][language-selected]' => TRUE,
  ], 'Save settings');

  // Set prefixes to en and fr.
  $this
    ->drupalPostForm('/admin/config/regional/language/detection/url', [
    'language_negotiation_url_part' => 'path_prefix',
    'prefix[en]' => 'en',
    'prefix[fr]' => 'fr',
  ], 'Save configuration');

  // Set Language Detection for selected language.
  $this
    ->drupalPostForm('/admin/config/regional/language/detection/selected', [
    'edit-selected-langcode' => 'en',
  ], 'Save configuration');

  // Clear cache to refresh changes.
  drupal_flush_all_caches();
}