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 | |
namespace Drupal\block\Controller; | |
use Symfony\Component\HttpFoundation\Response; | |
class AddressableBlock { | |
public function respond($block_id, $route) { | |
$build = array(); | |
$entity = block_load($block_id); |
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 | |
require './tests/bootstrap.php'; | |
function lib_files() { | |
$module_roots = array(); | |
foreach (scandir('./modules') as $module) { | |
if (!in_array($module, array('.', '..')) && is_dir("./modules/$module")) { | |
$module_roots[$module] = "./modules/$module/lib"; | |
} | |
} |
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
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc | |
index fd3b719..e9afc2c 100644 | |
--- a/core/includes/bootstrap.inc | |
+++ b/core/includes/bootstrap.inc | |
@@ -2289,6 +2289,8 @@ function _drupal_bootstrap_configuration() { | |
* Attempts to serve a page from the cache. | |
*/ | |
function _drupal_bootstrap_page_cache() { | |
+ // Not sure what to do with all this yet, but the whole phase most likely | |
+ // needs to be removed. |
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 | |
class SelectorTest extends PHPUnit_Framework_TestCase { | |
protected function setUp() { | |
$this->xml = new DomDocument; | |
$this->xml->loadXML('<div id="wtf"><div class="blah"></div></div>'); | |
} | |
public function testSelectors() { | |
$this->assertSelectCount('#wtf', 1, $this->xml); |
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
require "mechanize" | |
# your email | |
email = "" | |
loop do | |
@agent = Mechanize.new | |
page = @agent.get "https://secure.hilton.com/en/hhonors/optout/unsubscribe.jhtml" | |
form = page.form_with id: "nwsltrWidget" | |
form['/atg/userprofiling/Profile.crm.emailOptOut.email'] = email |
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 | |
namespace Drupal\Tests\Core; | |
use Drupal\Tests\UnitTestCase; | |
class SomeClass { | |
function someMethod() { | |
$executable = \Drupal\views\Views::executableFactory(); | |
$item = $executable->getItem('somedisplayid', 'sometype', 'someid'); |
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
# Kata Eight: Conflicting Objectives | |
# by Mark, Mark, and Lance | |
def words | |
@words ||= File.read('./wordsEn.txt').split("\r\n") | |
end | |
def six_letter_words(words) | |
words.reject do |word| | |
word.length != 6 |
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 | |
require 'mink.phar'; | |
class TestForChx extends PHPUnit_Framework_TestCase { | |
function testProveToChxWeAreNotCrazy() { | |
$clientOptions = array(); | |
$client = new \Behat\Mink\Driver\Goutte\Client(); | |
$client->setClient(new \Guzzle\Http\Client('', $clientOptions)); |
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 | |
namespace Drupal\Core\Routing; | |
use Drupal\Core\Access\AccessCheckInterface; | |
use Drupal\Core\Entity\EntityInterface; | |
use Symfony\Component\Routing\Route; | |
use Symfony\Component\HttpFoundation\Request; | |
use Drupal\Tests\UnitTestCase; |
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
#!/bin/sh | |
convert_test() { | |
FILE=$1 | |
sed -i '' -e's/simpletest\\UnitTestBase/Tests\\UnitTestCase/' "$FILE" | |
sed -i '' -e's/UnitTestBase/UnitTestCase/' "$FILE" | |
sed -i '' -e's/assertIdentical/assertSame/' "$FILE" | |
sed -i '' -e's/assertNotIdentical/assertNotSame/' "$FILE" | |
sed -i '' -e's/assertEqual(/assertEquals(/' "$FILE" | |
sed -i '' -e's/assertNotEqual(/assertNotEquals(/' "$FILE" |