LingotekAccountDisconnectFormTest.php in Lingotek Translation 8
File
src/Tests/Form/LingotekAccountDisconnectFormTest.php
View source
<?php
namespace Drupal\lingotek\Tests\Form;
use Drupal\lingotek\LingotekConfigTranslationServiceInterface;
use Drupal\lingotek\Tests\LingotekTestBase;
class LingotekAccountDisconnectFormTest extends LingotekTestBase {
public function testAccountDisconnect() {
$this
->drupalGet('admin/lingotek/settings');
$this
->drupalPostForm(NULL, [], t('Disconnect'), [], [], 'lingoteksettings-tab-account-form');
$this
->drupalPostForm(NULL, [], t('Disconnect'));
$this
->assertUrl('/admin/lingotek/setup/account');
$lingotek_config = \Drupal::config('lingotek.settings');
$this
->assertNull($lingotek_config
->get('account.access_token'));
$this
->assertNull($lingotek_config
->get('account.login_id'));
$this
->assertNull($lingotek_config
->get('account.callback_url'));
$this
->connectToLingotek();
$lingotek_config = \Drupal::config('lingotek.settings');
$this
->assertNotNull($lingotek_config
->get('account.access_token'));
$this
->assertNotNull($lingotek_config
->get('account.login_id'));
$this
->assertNotNull($lingotek_config
->get('account.callback_url'));
}
}