This file contains hidden or 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
function testFileCreate() { | |
$text_file = current($this->drupalGetTestFiles('text')); | |
$file = new stdClass(); | |
$realpath = realpath($text_file->filename); | |
$file->filesize = filesize($realpath); | |
$file->filepath = 'sites/default/files/' . $text_file->basename; | |
$fh = fopen($realpath, 'r'); | |
$file_data = fread($fh, $file->filesize); |
This file contains hidden or 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
Arguments: <?php array ( | |
'file' => | |
stdClass::__set_state(array( | |
'filesize' => 1024, | |
'filepath' => 'sites/default/files/text-1.txt', | |
'file' => 'MTEwMDAxMTEwMTEwMDAwMTEwMDExMTAxMTEwMDAxMTEwMTAxMTAxMTAwMTAwMTAwMDAwMDAxMTEwMTExMTEwCjEwMTExMTAwMTAwMDEwMDAwMTAxMTEwMTAwMTEwMDAwMDExMDExMTEwMTAwMTAwMDAxMTAwMDAwMTEwMTAwMQoxMDAxMDAwMDEwMDEwMTAwMDEwMDEwMDAxMDExMDAwMDExMDEwMTAxMTAxMTExMDExMDAxMTEwMDExMDAxMTEKMDAxMDAwMDAxMTExMTEwMTAwMTExMDEwMDExMTEwMDAwMTAxMTEwMTAxMTExMTAxMTAxMTExMDAwMTEwMDAwCjAxMDAxMDAxMTAwMTExMDExMDExMDAwMDEwMTAwMTAxMTExMTEwMDEwMDAwMDAwMTExMTEwMTEwMTEwMTEwMAoxMTAwMTAxMDEwMDEwMTEwMDExMDExMDEwMTExMTEwMDEwMTAxMDEwMDAwMTExMTAxMTEwMDExMTExMDAxMTAKMDEwMTAwMDExMTEwMDEwMTAwMDAwMDAwMTEwMDEwMTEwMTEwMTAwMDExMTAwMTExMDAxMDEwMTAwMDAxMDExCjAxMTEwMTExMTAxMTExMTExMDAwMTExMDAxMTExMTExMDExMTAwMTAxMDExMTEwMDExMDAwMTAwMDAwMDEwMAoxMTEwMDExMDAxMDAxMTAxMDEwMTAxMDEwMDAwMTAwMDAwMTExMTEwMDAwMDExMTEwMTExMTEwMDAxMDEwMTAKMDExMTEwMTAxMTAwMDAxMDExMDAxMTExMTAwMTAwMTExMTExMDAxMDAwMDEwMDAwMTAwMDAwMDAwMDExMDEwCjAxMTAxM |
This file contains hidden or 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 | |
// $Id$ | |
/** | |
* @file | |
* Call the endpoint tests when no authentication is being used. | |
* | |
*/ | |
require_once('ServicesWebTestCase.php') ; |
This file contains hidden or 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 | |
// $Id$ | |
/** | |
* Copyright (c) 2010 Madcap BV (http://www.madcap.nl) | |
* All rights reserved. | |
* | |
* Permission is granted for use, copying, modification, distribution, | |
* and distribution of modified versions of this work as long as the | |
* above copyright notice is included. |
This file contains hidden or 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
// Get database prefix. | |
$database_prefix = $GLOBALS['drupal_test_info']['test_run_id']; | |
// Generate user agent string. | |
if (preg_match('/simpletest\d+/', $database_prefix, $matches)) { | |
$user_agent = drupal_generate_test_ua($matches[0]); | |
} | |
else { | |
throw new Exception('Test is not ready to init connection to Webdriver (no database prefix)'); | |
} |
This file contains hidden or 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 | |
/** | |
* Preprocess function. | |
*/ | |
function example_preprocess_taxonomy_term(&$vars) { | |
if ($vars['vocabulary_machine_name'] == 'service_category') { | |
$contextual_links = array( | |
'#type' => 'contextual_links', | |
'#contextual_links' => array( | |
'taxonomy' => array('taxonomy/term', array($vars['tid'])), |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1>This is a heading</h1> | |
<h2>This is a heading</h2> | |
<h3>This is a heading</h3> | |
<p>My first paragraph.</p> |
This file contains hidden or 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
default: | |
suites: | |
default: | |
contexts: | |
- Drupal\DrupalExtension\Context\MinkContext | |
- FeatureContext | |
extensions: | |
Behat\MinkExtension: | |
base_url: http://mywebsite.com | |
goutte: |
This file contains hidden or 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
// Code provided by Acquia. | |
// Non balanced servers (dev and stage) don't have this problem. | |
if (!empty($conf['reverse_proxy_addresses'])) { | |
$ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); | |
$ips = array_map('trim', $ips); | |
// Add REMOTE_ADDR to the X-Forwarded-For list (the ip_address function will | |
// also do this) in case it's a 10. internal AWS address; if it is we should | |
// add it to the list of reverse proxy addresses so that ip_address will | |
// ignore it. | |
$ips[] = $_SERVER['REMOTE_ADDR']; |
This file contains hidden or 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
var page = require('webpage').create(), | |
address, output, size; | |
if (phantom.args.length < 4 || phantom.args.length > 5) { | |
console.log('Usage: viewport.js URL filename sizeX sizeY'); | |
phantom.exit(); | |
} else { | |
address = phantom.args[0]; | |
output = phantom.args[1]; | |
sizeX = phantom.args[2]; |
OlderNewer