/** * Tests the shortcut listing for the translate operation. */ public function doShortcutListTest() { // Create a test shortcut to decouple looking for translate operations // link so this does not test more than necessary. $shortcut = ShortcutSet::create(array('id' => Unicode::strtolower($this->randomMachineName(16)), 'label' => $this->randomString())); $shortcut->save(); // Get the shortcut listing. $this->drupalGet('admin/config/user-interface/shortcut'); $translate_link = 'admin/config/user-interface/shortcut/manage/' . $shortcut->id() . '/translate'; // Test if the link to translate the shortcut is on the page. $this->assertLinkByHref($translate_link); // Test if the link to translate actually goes to the translate page. $this->drupalGet($translate_link); $this->assertRaw('<th>' . t('Language') . '</th>'); }
/** * Creates a generic shortcut set. */ function generateShortcutSet($label = '', $id = NULL) { $set = ShortcutSet::create(array('id' => isset($id) ? $id : strtolower($this->randomName()), 'label' => empty($label) ? $this->randomString() : $label)); $set->save(); return $set; }