Skip to content
A collection of drivers for controlling Drupal.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
spec/Drupal/Driver basic start Mar 25, 2015
src/Drupal/Driver
tests/Drupal/Tests/Driver Fix update coding standards Apr 8, 2016
.gitignore
.travis.yml PHP 5.6 or higher is required. Jul 25, 2019
CHANGELOG.md Prep for 2.0.0 Sep 27, 2019
LICENSE Needs to be the same license as Drupal. Oct 15, 2014
README.md
composer.json
phpcs-ruleset.xml Prep for 2.0.0-alpha1. Mar 19, 2018
phpunit.xml.dist Unit tests for the Drush driver. Oct 17, 2014

README.md

Build Status

Provides a collection of light-weight drivers with a common interface for interacting with Drupal. These are generally intended for testing, and are not meant to be API-complete.

Read the full documentation

Latest Stable Version Total Downloads License Scrutinizer Code Quality

Drivers

These drivers support Drupal versions 7 and 8.

  • Blackbox
  • Direct Drupal API bootstrap
  • Drush

Installation

{
  "require": {
    "drupal/drupal-driver": "~2.0"
  }
}
$> curl -sS http://getcomposer.org/installer | php
$> php composer.phar install

Usage

<?php

use Drupal\Driver\DrupalDriver;

require 'vendor/autoload.php';

// Path to Drupal.
$path = './drupal-8';

// Host.
$uri = 'http://d8.devl';

$driver = new DrupalDriver($path, $uri);
$driver->setCoreFromVersion();

// Bootstrap Drupal.
$driver->bootstrap();

// Create a node.
$node = (object) array(
  'type' => 'article',
  'uid' => 1,
  'title' => $driver->getRandom()->name(),
);
$driver->createNode($node);

Release notes

See CHANGELOG.

You can’t perform that action at this time.