PHPackages                             sikofitt/mocks-drupal-variables - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. sikofitt/mocks-drupal-variables

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

sikofitt/mocks-drupal-variables
===============================

Mock for drupal variable functions variable\_(set,get,del)

v1.0.3(9y ago)08.2k1GPL-3.0PHPPHP &gt;=5.3

Since Aug 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/sikofitt/mocks-drupal-variables)[ Packagist](https://packagist.org/packages/sikofitt/mocks-drupal-variables)[ RSS](/packages/sikofitt-mocks-drupal-variables/feed)WikiDiscussions v1.0.x Synced today

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Drupal Variable Mock [![Build Status](https://camo.githubusercontent.com/9d030f93eef16e4bec264be43993c8663866db606dce4c066add538dbb6e2000/68747470733a2f2f7472617669732d63692e6f72672f73696b6f666974742f6d6f636b732d64727570616c2d7661726961626c65732e7376673f6272616e63683d76312e302e32)](https://travis-ci.org/sikofitt/mocks-drupal-variables)
=================================================================================================================================================================================================================================================================================================================================================

[](#drupal-variable-mock-)

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

Versions
--------

[](#versions)

Drupal 7.x

Usage
-----

[](#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
------------

[](#requirements)

PHP &gt;=5.3

Tests
-----

[](#tests)

phpunit

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3613d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca20b56d1cdac9dab6ef37ad857e2b924216ac7cbc8c5233846437a303ac837a?d=identicon)[sikofitt](/maintainers/sikofitt)

---

Top Contributors

[![sikofitt](https://avatars.githubusercontent.com/u/3673285?v=4)](https://github.com/sikofitt "sikofitt (11 commits)")

---

Tags

configdrupalmock

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sikofitt-mocks-drupal-variables/health.svg)

```
[![Health](https://phpackages.com/badges/sikofitt-mocks-drupal-variables/health.svg)](https://phpackages.com/packages/sikofitt-mocks-drupal-variables)
```

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k516.1M26.2k](/packages/mockery-mockery)[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k557.4M751](/packages/phpspec-prophecy)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

36919.3M119](/packages/php-mock-php-mock)[phake/phake

The Phake mock testing library

4758.2M341](/packages/phake-phake)[brain/monkey

Mocking utility for PHP functions and WordPress plugin API

34213.7M442](/packages/brain-monkey)[kahlan/kahlan

The PHP Test Framework for Freedom, Truth and Justice.

1.1k1.2M255](/packages/kahlan-kahlan)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
