Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
/ DrupalDriver Public archive
forked from jhedstrom/DrupalDriver

ARCHIVED. Will be removed on 1 July 2024. Fork of jhedstrom/DrupalDriver to be used in drevops/behat-steps

License

Notifications You must be signed in to change notification settings

drevops/DrupalDriver

 
 

Repository files navigation

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.

About

ARCHIVED. Will be removed on 1 July 2024. Fork of jhedstrom/DrupalDriver to be used in drevops/behat-steps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%