-
Environment variables:
export SIMPLETEST_DB=mysql://user:pass@localhost/db_name export SIMPLETEST_BASE_URL=http://d8.dev
-
or copy
core/phpunit.xml.dist
tocore/phpunit.xml
and edit accordingly
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\mymodule\EventSubscriber; | |
use Drupal\mymodule\ExternalRedirectHelper; | |
use Drupal\Core\Routing\TrustedRedirectResponse; | |
use Drupal\node\NodeInterface; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpKernel\Event\RequestEvent; |
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\my_module\Form; | |
use Drupal\Core\Datetime\Element\Datetime; | |
use Drupal\Core\Form\FormStateInterface; | |
/** | |
* Utility functions and static callbacks for MY MODULE module. | |
*/ |
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 | |
* Install file for content_moderation. | |
*/ | |
use Drupal\content_moderation\Entity\ContentModerationState; | |
use Drupal\Core\Field\BaseFieldDefinition; | |
use Drupal\Core\Database\Database; |
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
> drush php | |
Psy Shell v0.8.2 (PHP 7.0.13 — cli) by Justin Hileman | |
>>> $one = Drupal\views\Render\ViewsRenderPipelineMarkup::create(1); | |
=> Drupal\views\Render\ViewsRenderPipelineMarkup {#8821} | |
>>> $two = Drupal\Core\Render\Markup::create(2); | |
=> Drupal\Core\Render\Markup {#8818} | |
>>> $two > $one; | |
=> false | |
>>> $two == $one; | |
=> false |
I hereby claim:
- I am jhedstrom on github.
- I am jhedstrom (https://keybase.io/jhedstrom) on keybase.
- I have a public key whose fingerprint is EDCF B052 5C7D 0FD2 5491 12DB 846B C2BE 8B13 F40F
To claim this, I am signing this object:
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 | |
/** | |
* @AfterStep | |
*/ | |
public function takeScreenShotAfterFailedStep(AfterStepScope $scope) { | |
if (99 === $scope->getTestResult()->getResultCode()) { | |
$driver = $this->getSession()->getDriver(); | |
if (!($driver instanceof Selenium2Driver)) { | |
return; |
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 | |
/** | |
* @Given /^I am logged in as a user in the "(?P<group>[^"]*)" group$/ | |
*/ | |
public function iAmLoggedInAsAUserInTheGroup($group) { | |
// Create user. | |
$account = (object) array( | |
'pass' => $this->getDrupal()->random->name(), | |
'name' => $this->getDrupal()->random->name(), | |
); |
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 | |
/** | |
* Provide actual overridden view config. | |
*/ | |
protected function getOverriddenView() { | |
$view = array( | |
'display' => array( | |
'default' => array( | |
'display_options' => 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
$> drush use @existing-d7-site | |
$> drush dl composer_generate | |
$> mkdir /tmp/new-site | |
$> drush composer-generate > /tmp/new-site/composer.json | |
$> cd /tmp/new-site | |
$> composer install | |
$> composer require drupal/views |
NewerOlder