This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Masquerade block in the Navbar Region. | |
*/ | |
#masquerade-block-1 div#autocomplete ul { | |
padding-top: 3px; | |
float: left; | |
width: 300px !important; | |
margin-top: 30px; | |
position: absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* sites/all/drush/play.drush.php | |
* | |
* Oftentimes one needs to run an operation on a list of things. | |
* If this list is of variable length, running it in one process may | |
* cause a time out and/or out of memory. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @Then I fill in wysiwyg on field :locator with :value | |
*/ | |
public function iFillInWysiwygOnFieldWith($locator, $value) { | |
$el = $this->getSession()->getPage()->findField($locator); | |
if (empty($el)) { | |
throw new ExpectationException('Could not find WYSIWYG with locator: ' . $locator, $this->getSession()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function drupal_run_as($user, $func) { | |
global $user; | |
$original_user = $user; | |
$old_state = drupal_save_session(); | |
drupal_save_session(FALSE); | |
$args = func_get_args(); | |
$user = array_shift($args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @When I fill in the autocomplete :autocomplete with :text and click :popup | |
*/ | |
public function fillInDrupalAutocomplete($autocomplete, $text, $popup) { | |
$el = $this->getSession()->getPage()->findField($autocomplete); | |
$el->focus(); | |
// Set the autocomplete text then put a space at the end which triggers | |
// the JS to go do the autocomplete stuff. | |
$el->setValue($text); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_menu_alter(). | |
*/ | |
function mymodule_menu_alter(&$items) { | |
if (isset($items['user/%user'])) { | |
// Turn user/%user into an edit form callback rather than view. | |
$items['user/%user']['page callback'] = 'drupal_get_form'; | |
$items['user/%user']['page arguments'] = array('user_profile_form', 1); | |
$items['user/%user']['access callback'] = 'user_edit_access'; | |
$items['user/%user']['access arguments'] = array(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_views_query_alter(). | |
* | |
* This is a view of users and the view has a relationship to node and a contextual filter. | |
* There is an entity reference field on the user pointing to the node called field_node_entity_reference. | |
* | |
* By placing the restiction on the join and not requiring the relationship means we can additional exposed filters | |
* such as where node.nid is empty (users who do not link to the node). | |
*/ | |
function mymodule_views_query_alter(&$view, &$query) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* | |
* Add this code in a file features/bootstrap/PersonaContext.php | |
* | |
* Include the PersonaContext in behat.yml like this ... | |
* | |
* default: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @When I click :link_text in table row containing :text | |
*/ | |
public function iClickOperationLinkInTableRowWithText($link_text, $text) { | |
$session = $this->getSession(); | |
$el = $session->getPage()->find('xpath', "//td[contains(., '{$text}')]"); | |
if (empty($el)) { | |
throw new ExpectationException(t('No such text in table - @text', array( | |
'@text' => $text, |
NewerOlder