Skip to content

Instantly share code, notes, and snippets.

View stevector's full-sized avatar

Steve Persch stevector

View GitHub Profile
/**
* WordPress dependencies
*/
import { isValidBlockContent } from '@wordpress/blocks';
import { createElement } from '@wordpress/element';
describe( 'isValidBlockContent', () => {
beforeAll( () => {
// Load all hooks that modify blocks
require( '../../packages/editor/src/hooks' );
@stevector
stevector / 1.js
Created July 25, 2019 21:40 — forked from Shelob9/1.js
//do not test like this please!
test("Form component value", () => {
//Props with sample data
const props = {
defaultValue: "Food",
className: "wp-blocks-tooths",
id: "something"
};
//Render component
@stevector
stevector / wp-redis--behat.yml
Last active April 15, 2017 19:20
Code Samples for Bending Behat's Benefits
# Adapted from https://github.com/pantheon-systems/wp-redis/blob/v0.6.1/behat.yml
default:
suites:
default:
paths:
- tests/behat
contexts:
- Behat\MinkExtension\Context\MinkContext
- PantheonSystems\PantheonWordPressUpstreamTests\Behat\AdminLogIn
core:
@stevector
stevector / gist:d3cfcd0b8e449aaf93ca2bf7ac2dbf2c
Created August 9, 2016 21:41
Repeated installs of Drupal minimum profile to with PHP 5.6 and PHP 7
echo "php_version: 5.6" >> pantheon.yml
git add pantheon.yml
git commit -m 'Setting php 5.6'
git push
sleep 30
for i in $(seq 20); do
echo "Site install $i in PHP 5.6"
terminus drush "si minimal -y"
@stevector
stevector / direct_print
Created May 4, 2014 20:37
Directly placing Drupal blocks in a Twig file
{#
I suspect Drupal site builders will eventually to be able
to put block instances into twig files without being limited
to a theme's regions. Calling a function to print them
anywhere is farirly simple.
#}
{{ drupal_block_placement('bartik_breadcrumbs') }}