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 | |
* Contains \Drupal\node\Tests\NodeViewTest. | |
*/ | |
namespace Drupal\node\Tests; | |
/** |
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 | |
/** | |
* Run before every scenario. | |
* | |
* @BeforeScenario | |
*/ | |
public function beforeScenario() { | |
if ($basic_auth = $this->getDrupalParameter('basic_auth')) { | |
$driver = $this->getSession()->getDriver(); | |
if ($driver instanceof Selenium2Driver) { |
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 | |
/** | |
* 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) { |
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 | |
* 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. |
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 | |
/** | |
* Register a shutdown function. | |
* | |
* We manually call shutdown functions, so register one to exit immediately. | |
* | |
* @BeforeSuite | |
*/ | |
public static function registerShutdownFunction() { |
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 | |
// 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)); |
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 | |
* Per-user badges/achievements CTools content type plugin. | |
*/ | |
/** | |
* The Achievements plugin definition. | |
*/ | |
$plugin = array( |
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 | |
* Custom Entity Reference selection handler. | |
*/ | |
class MyModuleSelectionHandler extends OgSelectionHandler { | |
/** |
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 | |
/** | |
* @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, |
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
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 & |