Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-driver / README.md
1 [![Build Status](https://travis-ci.org/jhedstrom/DrupalDriver.svg?branch=master)](https://travis-ci.org/jhedstrom/DrupalDriver)
2
3 Provides a collection of light-weight drivers with a common interface for interacting with [Drupal](http://drupal.org). These are generally intended for testing, and are not meant to be API-complete.
4
5 [Read the full documentation](http://drupal-drivers.readthedocs.org)
6
7 [![Latest Stable Version](https://poser.pugx.org/drupal/drupal-driver/v/stable.svg)](https://packagist.org/packages/drupal/drupal-driver) [![Total Downloads](https://poser.pugx.org/drupal/drupal-driver/downloads.svg)](https://packagist.org/packages/drupal/drupal-driver) [![License](https://poser.pugx.org/drupal/drupal-driver/license.svg)](https://packagist.org/packages/drupal/drupal-driver) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jhedstrom/DrupalDriver/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/jhedstrom/DrupalDriver/?branch=master)
8
9 ### Drivers
10
11 These drivers support Drupal versions 7 and 8.
12
13 * Blackbox
14 * Direct Drupal API bootstrap
15 * Drush
16
17 ### Installation
18
19 ``` json
20 {
21   "require": {
22     "drupal/drupal-driver": "~1.0"
23   }
24 }
25 ```
26
27 ``` bash
28 $> curl -sS http://getcomposer.org/installer | php
29 $> php composer.phar install
30 ```
31
32 ### Usage
33
34 ``` php
35 <?php
36
37 use Drupal\Driver\DrupalDriver;
38 use Drupal\Driver\Cores\Drupal8;
39
40 require 'vendor/autoload.php';
41
42 // Path to Drupal.
43 $path = './drupal-8';
44
45 // Host.
46 $uri = 'http://d8.devl';
47
48 $driver = new DrupalDriver($path, $uri);
49 $driver->setCoreFromVersion();
50
51 // Bootstrap Drupal.
52 $driver->bootstrap();
53
54 // Create a node.
55 $node = (object) array(
56   'type' => 'article',
57   'uid' => 1,
58   'title' => $driver->getRandom()->name(),
59 );
60 $driver->createNode($node);
61 ```