You are here

public function ContextTest::testSmartlingContextDebuggerFormNoAvailableConfigs in TMGMT Translator Smartling 8.4

Test Smartling context debugger: no available configs.

File

tests/src/Functional/ContextTest.php, line 86

Class

ContextTest
Context tests.

Namespace

Drupal\Tests\tmgmt_smartling\Functional

Code

public function testSmartlingContextDebuggerFormNoAvailableConfigs() {
  if (!empty($this->smartlingPluginProviderSettings)) {
    $smartling_provider_configs = \Drupal::getContainer()
      ->get('tmgmt_smartling.smartling_config_manager')
      ->getAvailableConfigs();
    foreach ($smartling_provider_configs as $smartling_provider_config) {
      \Drupal::configFactory()
        ->getEditable($smartling_provider_config
        ->getName())
        ->delete();
    }
    $this
      ->drupalGet('admin/tmgmt/smartling-context-debug');
    $this
      ->assertText('No Smartling configs found. Please create Smartling config first');
  }
  else {
    $this
      ->fail("Smartling settings file for simpletests not found.");
  }
}