build2be / drupal-rest-test

Test some rest functionalities against Drupal 8 REST and HAL server
8 stars 3 forks source link

.. Drupal REST test documentation master file, created by sphinx-quickstart on Wed Jul 9 12:30:47 2014. You can adapt this file completely to your liking, but it should at least contain the root toctree directive.

About this project

As setting up a test environment is cumbersome this project provides for a install and test script.

It has a POST script to try posting entities into Drupal 8

DIY HAL POST a node is https://www.drupal.org/node/2098511

Known issues:

Requirements

. You should have a running Drupal 8 <https://www.drupal.org/node/3060/git-instructions/8.x>_ install

. You must have installed Drush <https://github.com/drush-ops/drush>_

. You need to know how to write Drush aliases <http://drush.ws/examples/example.aliases.drushrc.php>_

 ``$ vi ~/.drush/drupal.aliases.drushrc.php``

Alias file content::

$aliases['d8'] = array ( 'root' => '/Users/clemens/Sites/drupal/d8/www', 'uri' => 'http://drupal.d8', 'databases' => array ( 'default' => array ( 'default' => array ( 'database' => 'drupal_d8', 'username' => 'drupal_d8', 'password' => 'drupal_d8', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => '', ), ), ), );

How to install

Install HAL browser

To test HAL navigation install https://github.com/mikekelly/hal-browser

Command line options

Run $ ./rest.sh gives:

Run with one of the following argument(s) in order of appearance:

Quick start argument sets are:

Step by step arguments are:

Test POST using HAL

Create a clear install with supporting modules::

./rest.sh install-modules install
./rest.sh hal-set hal config
./rest.sh hal node comment user # writes node/1 comment/1 and user/1 into /data dir
php ./post.php # tries to post new node, comment, user