ContentHubMultilingualSettingsWebhookTest.php in Acquia Content Hub 8.2
File
tests/src/Functional/ContentHubMultilingualSettingsWebhookTest.php
View source
<?php
namespace Drupal\Tests\acquia_contenthub\Functional;
use Drupal\Core\Url;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\Tests\BrowserTestBase;
class ContentHubMultilingualSettingsWebhookTest extends BrowserTestBase {
protected $authorizedUser;
protected $defaultTheme = 'stark';
public static $modules = [
'acquia_contenthub',
'language',
'locale',
];
protected function setUp() {
parent::setUp();
$this->authorizedUser = $this
->drupalCreateUser([], NULL, TRUE);
$this
->drupalLogin($this->authorizedUser);
ConfigurableLanguage::createFromLangcode('fr')
->save();
$this
->drupalPostForm('/admin/config/regional/language/detection', [
'language_interface[enabled][language-url]' => TRUE,
'language_interface[enabled][language-selected]' => TRUE,
], 'Save settings');
$this
->drupalPostForm('/admin/config/regional/language/detection/url', [
'language_negotiation_url_part' => 'path_prefix',
'prefix[en]' => 'en',
'prefix[fr]' => 'fr',
], 'Save configuration');
$this
->drupalPostForm('/admin/config/regional/language/detection/selected', [
'edit-selected-langcode' => 'en',
], 'Save configuration');
drupal_flush_all_caches();
}
public function testContentHubWebhookPath() {
$webhook_path = Url::fromRoute('acquia_contenthub.webhook')
->toString();
$this
->assertEqual($webhook_path, '/acquia-contenthub/webhook');
}
}