Use dnsmasq to serve up the local address for any subdomain of "dev"
Requires a working dnsmasq configuration. (May require reboot.)
sudo apt-get install dnsmasq
<?php | |
/** | |
* @Given /^I am viewing a product with the following related products:$/ | |
*/ | |
public function assertRelatedProducts(TableNode $relatedProducts) { | |
// First, create a product. | |
$product = (object) array( | |
'title' => 'Parent Product', | |
'type' => 'product', | |
'uid' => 1, |
if [ ! -f /tmp/.X5-lock ]; then /usr/bin/Xvfb :5 -ac -screen 0 1024x768x8 & fi | |
export DISPLAY=:5.0 # firefox needs this to know where to find a display to run on | |
java -jar /opt/selenium/selenium-server-standalone-2.26.0.jar > /dev/null 2>&1 & |
<?php | |
/** | |
* @Then /^the google "(?P<variable>[^"]*)" variable should be set to "(?P<value>[^"]*)"$/ | |
*/ | |
public function assertGoogleAnalyticsCustomVariable($variable, $value) { | |
$map = array( | |
// Custom variable name => Custom variable index. | |
'gender' => 1, | |
'age range' => 2, |
<?php | |
/** | |
* @file | |
* Custom Entity Reference selection handler. | |
*/ | |
class MyModuleSelectionHandler extends OgSelectionHandler { | |
/** |
<?php | |
/** | |
* @file | |
* Per-user badges/achievements CTools content type plugin. | |
*/ | |
/** | |
* The Achievements plugin definition. | |
*/ | |
$plugin = array( |
<?php | |
// Snippet method in FeatureContext class. | |
/** | |
* @Then /^I should see the "(?P<achievement>[^"]*)" achievement "(?P<status>[^"]*)"$/ | |
*/ | |
public function iShouldSeeTheAchievement($achievement, $status) { | |
if (!in_array($status, array('unlocked', 'locked'))) { | |
throw new \Exception(sprintf("Achievement status should either be 'locked' or 'unlocked', '%s' given instead.", $status)); |
<?php | |
/** | |
* Register a shutdown function. | |
* | |
* We manually call shutdown functions, so register one to exit immediately. | |
* | |
* @BeforeSuite | |
*/ | |
public static function registerShutdownFunction() { |
<?php | |
/** | |
* @file | |
* A health-check probe for Varnish. | |
* | |
* Based on the probe found here | |
* http://www.lullabot.com/blog/article/configuring-varnish-high-availability-multiple-web-servers | |
*/ | |
// Register our shutdown function so that no other shutdown functions run before this one. |
<?php | |
/** | |
* Implements hook_search_api_solr_documents_alter(). | |
* | |
* Legacy pages should simply be indexed as normal pages. | |
*/ | |
function MYMODULE_search_api_solr_documents_alter(array &$documents, SearchApiIndex $index, array $items) { | |
if ($index->item_type == 'node') { | |
foreach ($documents as $document) { |