/** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->installEntitySchema('menu_link_content'); $this->installEntitySchema('node'); $this->installConfig(['node']); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); // Add the languages. $this->installConfig(['language']); $this->installEntitySchema('tmgmt_job'); $this->installEntitySchema('tmgmt_job_item'); $this->installEntitySchema('tmgmt_message'); $this->installSchema('system', array('router')); $this->installSchema('locale', array('locales_location', 'locales_source', 'locales_target')); \Drupal::service('router.builder')->rebuild(); tmgmt_translator_auto_create(\Drupal::service('plugin.manager.tmgmt.translator')->getDefinition('test_translator')); }
/** * {@inheritdoc} */ function setUp() { parent::setUp(); $this->langcode = 'de'; $this->context = 'default'; \Drupal::service('router.builder')->rebuild(); $this->installSchema('locale', array('locales_source', 'locales_target')); file_unmanaged_copy(drupal_get_path('module', 'tmgmt_locale') . '/tests/test.de.po', 'translations://', FILE_EXISTS_REPLACE); $file = new \stdClass(); $file->uri = \Drupal::service('file_system')->realpath(drupal_get_path('module', 'tmgmt_locale') . '/tests/test.xx.po'); $file->langcode = $this->langcode; Gettext::fileToDatabase($file, array()); $this->addLanguage('es'); }
function createJobWithItems($action = 'translate') { $job = parent::createJob(); for ($i = 1; $i < 3; $i++) { if ($i == 3) { // Explicitly define the data for the third item. $data['data'] = array('dummy' => array('deep_nesting' => array('#text' => 'Stored data'))); $job->addItem('test_source', 'test', $i, array($data)); } $job->addItem('test_source', 'test', $i); } // Manually specify the translator for now. $job->translator = $this->default_translator->id(); $job->settings = array('action' => $action); return $job; }