public function ContextTest::testSilentSwitchingOff in TMGMT Translator Smartling 8.4
Same name and namespace in other branches
- 8.3 tests/src/Functional/ContextTest.php \Drupal\Tests\tmgmt_smartling\Functional\ContextTest::testSilentSwitchingOff()
Test context uploading with turned off "Silent switching mode" feature.
File
- tests/
src/ Functional/ ContextTest.php, line 142
Class
- ContextTest
- Context tests.
Namespace
Drupal\Tests\tmgmt_smartling\FunctionalCode
public function testSilentSwitchingOff() {
if (!empty($this->smartlingPluginProviderSettings)) {
$translator = $this
->setUpSmartlingProviderSettings($this->smartlingPluginProviderSettings);
$job = $this
->requestTranslationForNode($this->testNodeId, $this->targetLanguage, $translator);
$fileName = $job
->getTranslatorPlugin()
->getFileName($job);
$this
->cronRun();
$this
->drupalGet('admin/reports/dblog');
$this
->assertRaw('We are about to switch user');
$this
->assertRaw(t('User @name has logged out.', [
'@name' => 'Anonymous',
]));
$this
->assertRaw(t('User @name has logged in.', [
'@name' => $this->smartlingPluginProviderSettings['settings[contextUsername]'],
]));
$this
->assertRaw('User was successfully switched');
$this
->assertRaw(t('Context upload for file @filename completed successfully.', [
'@filename' => $fileName,
]));
}
else {
$this
->fail("Smartling settings file for simpletests not found.");
}
}