Skip to content

Instantly share code, notes, and snippets.

View fmitchell's full-sized avatar

Fredric Mitchell fmitchell

View GitHub Profile
@fmitchell
fmitchell / AuthorArticleExampleTest.php
Created September 11, 2020 13:28
Example Author editing article Drupal Test Trait test
<?php
namespace Drupal\Tests\sw_editorial\ExistingSiteJavascript;
use Drupal\Core\Entity\EntityStorageException;
use Drupal\user\Entity\Role;
use Drupal\user\Entity\User;
use weitzman\DrupalTestTraits\ExistingSiteWebDriverTestBase;
class AuthorManageArticleTest extends ExistingSiteWebDriverTestBase {

Keybase proof

I hereby claim:

  • I am fmitchell on github.
  • I am fredric (https://keybase.io/fredric) on keybase.
  • I have a public key ASAtYI5djYEu7TR1TkA_IpVB0IVCQSebXnaUdfFUel8jrAo

To claim this, I am signing this object:

@fmitchell
fmitchell / gist:6079933
Last active November 14, 2016 14:53
Migrate example using migrate, migrate_d2d, migrate_extras
<?php
/**
* This is example code for a Drupal 6 to Drupal 7 migration. This won't actually
* work without defining the referenced vocabularies, content types, and fields
* on each side.
*/
/**
* Implements hook_flush_caches().
# Behat configuration file.
# This is the default profile that will be used unless a profile argument is
# specified. Override this profile in behat.local.yml which is not version controlled.
default:
extensions:
Behat\MinkExtension\Extension:
goutte:
guzzle_parameters:
curl.CURLOPT_SSL_VERIFYPEER: false
$machine_type = variable_get('state_flow_' . $node->type, 'state_flow');
$module = 'state_flow';
//allow other modules to invoke other plugins
drupal_alter('state_flow_plugin', array('machine_type' => $machine_type, 'module' => $module));
$plugin = ctools_get_plugins($module, 'plugins', $machine_type);
$machine_type = variable_get('state_flow_' . $node->type, 'state_flow');
$module = 'state_flow';
//allow other modules to invoke other plugins
drupal_alter('state_flow_plugin', array('machine_type' => $machine_type, 'module' => $module));
$plugin = ctools_get_plugins($module, 'plugins', $machine_type);