2017 © Pedro Peláez
 

library codeception-drupal-variable

A Codeception module to allow Drupal variables to be tested and set during tests

image

ixis/codeception-drupal-variable

A Codeception module to allow Drupal variables to be tested and set during tests

  • Monday, April 4, 2016
  • by pfaocle
  • Repository
  • 4 Watchers
  • 0 Stars
  • 1,490 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 8 Versions
  • 22 % Grown

The README.md

Drupal Variable

Codeception module to allow testing of drupal variables., (*1)

e.g., (*2)

// Assert that the target site has variable "clean_url" set to 1
$I->seeVariable("clean_url", 1);

// Set a variable.
$I->haveVariable("clean_url", 0);

// Delete a variable.
$I->dontHaveVariable("clean_url");

// Retrieve a variable value.
$value = $I->getVariable("clean_url");

There are three ways of accessing the variable values., (*3)

  • Bootstrapped - bootstrap the locally installed drupal instance and use variable_get/set().
  • DirectConnection - use PDO to query the database directly.
  • Drush - use drush to get/set variables.

Install

Install using composer, using git repository (for now)., (*4)

"require": {
    "ixis/codeception-drupal-variable": "~0.3"
}

Configure

Add 'DrupalVariable' module to the suite configuration., (*5)

class_name: AcceptanceTester
modules:
    enabled:
        - DrupalVariable

Bootstrapped

DrupalVariable:
  class: Codeception\Module\Drupal\Variable\VariableStorage\Bootstrapped

Required config variables:, (*6)

  • drupal_root. This is the path the local instance of the drupal site you wish to set/get variables on.
    • e.g. /home/sites/www.example.com

Direct connection to database

DrupalVariable:
  class: Codeception\Module\Drupal\Variable\VariableStorage\DirectConnection

Required config variables:, (*7)

  • dsn - dsn to the instance of the drupal site db.
    • e.g. mysql:host=localhost;dbname=drupal
  • user - the db user
  • password - the db password

Drush

DrupalVariable:
  class: Codeception\Module\Drupal\Variable\VariableStorage\Drush

Required config variables:, (*8)

  • drush_alias - the drush alias to the site under test.
    • e.g. @mysite.local

The Versions

04/04 2016

dev-master

9999999-dev https://github.com/ixis/codeception-drupal-variable

A Codeception module to allow Drupal variables to be tested and set during tests

  Sources   Download

MIT

04/04 2016

0.3.3

0.3.3.0 https://github.com/ixis/codeception-drupal-variable

A Codeception module to allow Drupal variables to be tested and set during tests

  Sources   Download

MIT

04/04 2016

dev-develop

dev-develop https://github.com/ixis/codeception-drupal-variable

A Codeception module to allow Drupal variables to be tested and set during tests

  Sources   Download

MIT

26/02 2016

0.3.2

0.3.2.0 https://github.com/ixis/codeception-drupal-variable

A Codeception module to allow Drupal variables to be tested and set during tests

  Sources   Download

MIT

09/02 2016

0.3.1

0.3.1.0 https://github.com/ixis/codeception-drupal-variable

A Codeception module to allow Drupal drush commands to be run during tests

  Sources   Download

MIT

09/02 2016

0.3.0

0.3.0.0

A Codeception module to allow Drupal drush commands to be run during tests

  Sources   Download

27/08 2014

0.2

0.2.0.0

A Codeception module to allow drush commands to be run during tests.

  Sources   Download

27/08 2014

0.1

0.1.0.0

A Codeception module to allow drush commands to be run during tests.

  Sources   Download