This repository has been archived on 2024-04-06. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
R. Eric Wheeler ca3042b65a Update readme 2016-08-08 08:21:51 -07:00
src/Sikofitt/Mocks/Drupal Added readme 2016-08-08 07:56:35 -07:00
tests Fixed coverage tests 2016-08-08 08:05:55 -07:00
.gitignore Initial commit 2016-08-05 15:01:21 -07:00
.travis.yml Added readme 2016-08-08 07:56:35 -07:00
LICENSE Add License 2016-08-08 07:25:54 -07:00
README.md Update readme 2016-08-08 08:21:51 -07:00
bootstrap.php Added tests 2016-08-08 07:22:38 -07:00
composer.json Added readme 2016-08-08 07:56:35 -07:00
composer.lock Update readme 2016-08-08 08:21:51 -07:00
phpunit.xml.dist Added tests 2016-08-08 07:22:38 -07:00

README.md

Drupal Variable Mock Build Status

Mocks for drupal variable functions variable_(set,get,del) for testing outside of Drupal

Versions

Drupal 7.x

Usage

composer require sikofitt/mocks-drupal-variables

require 'vendor/autoload.php'

Then just use as if you were in drupal.

variable_set('myvar', 'myvalue');
variable_get('myvar'); // myvalue
variable_del('myvar');
variable_get('myvar', 'default_if_not_found'); // default_if_not_found

Just like drupal, every function returns null, except variable_get. But variable_get will return null if the value is not found and no default was given.

Requirements

PHP >=5.3

Tests

phpunit