function TMGMTLocalTestCase::testAllowAll in Translation Management Tool 7
Test the allow all setting.
File
- translators/
tmgmt_local/ tmgmt_local.test, line 447 - Test cases for the local translator module.
Class
- TMGMTLocalTestCase
- Basic tests for the local translator.
Code
function testAllowAll() {
$translator = tmgmt_translator_load('local');
// Create a job and request a local translation.
$this
->loginAsTranslator();
$job = $this
->createJob();
$job->translator = $translator->name;
$job
->addItem('test_source', 'test', '1');
$job
->addItem('test_source', 'test', '2');
$this
->assertFalse($job
->requestTranslation(), 'Translation request was denied.');
// Now enable the setting.
$translator->settings['allow_all'] = TRUE;
$translator
->save();
$this
->assertIdentical(NULL, $job
->requestTranslation(), 'Translation request was successfull');
$this
->assertTrue($job
->isActive());
}