PHPackages                             chillu/fakedatabase - 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. chillu/fakedatabase

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

chillu/fakedatabase
===================

Simple 'database' storage adapter which persists into a JSON file

3.0.0(3y ago)33.2k↓50%31BSD-2-ClausePHPPHP ^7.2 || ^8.0

Since Dec 5Pushed 3y ago2 watchersCompare

[ Source](https://github.com/chillu/fakedatabase)[ Packagist](https://packagist.org/packages/chillu/fakedatabase)[ RSS](/packages/chillu-fakedatabase/feed)WikiDiscussions master Synced 1mo ago

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

Fake JSON Database
==================

[](#fake-json-database)

[![Build Status](https://camo.githubusercontent.com/d8318ca914e90675e518386ce7f5976d88defe53e31e23b92b284b1feb7c8e8f/68747470733a2f2f6170692e7472617669732d63692e6f72672f6368696c6c752f66616b6564617461626173652e706e67)](https://travis-ci.org/chillu/fakedatabase)

Introduction
------------

[](#introduction)

Simple "database" storage adapter which persists into a JSON file, making it easy to see the whole database state at a glance. It also carries all the benefits of "schema-less" storage, and doesn't have external dependencies on database drivers. This makes it useful for lightweight storage of test data, e.g. when recording and tracking data changes in integration tests.

The storage is optimized for developer readability as opposed to performance, since the file is persisted on disk every time a change is made.

Usage
-----

[](#usage)

```
// Instanciation
$db = new FakeDatabase('/tmp/my_database.json');

// Set a new object with the key 'john' (or override an existing one)
$db->set('User', 'john', new FakeObject(array(
	'email' => 'john@test.com',
	'firstname' => 'John',
	'address' => array(
		'street' => 'Test Road',
		'city' => 'Testington',
		'postcode' => 9999
	)
)));

// Update (merges with existing data through array_merge())
$db->update('User', 'john', new FakeObject(array('surname' => 'Test')));

// Get all objects for a certain type
$objs = $db->getAll('User');

// Get by key
$obj = $db->get('User', 'john');

// Simple find
$obj = $db->find('User', 'email', 'john@test.com');

// Complex find by dot notation
$obj - $db->find('User', 'address.postcode', 9999);

// Reset the whole database
$db->reset('User', 'address.postcode', 9999);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 61.5% 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 ~497 days

Total

3

Last Release

1354d ago

Major Versions

1.0.0 → 2.0.02019-12-05

2.0.0 → 3.0.02022-08-24

PHP version history (2 changes)1.0.0PHP ^7.2

3.0.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/111025?v=4)[Ingo Schommer](/maintainers/chillu)[@chillu](https://github.com/chillu)

---

Top Contributors

[![chillu](https://avatars.githubusercontent.com/u/111025?v=4)](https://github.com/chillu "chillu (8 commits)")[![madmatt](https://avatars.githubusercontent.com/u/893117?v=4)](https://github.com/madmatt "madmatt (4 commits)")[![IgorNadj](https://avatars.githubusercontent.com/u/667652?v=4)](https://github.com/IgorNadj "IgorNadj (1 commits)")

---

Tags

jsontestingdatabase

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/chillu-fakedatabase/health.svg)

```
[![Health](https://phpackages.com/badges/chillu-fakedatabase/health.svg)](https://phpackages.com/packages/chillu-fakedatabase)
```

###  Alternatives

[guanguans/laravel-soar

SQL optimizer and rewriter for laravel. - laravel 的 SQL 优化器和重写器。

2227.8k](/packages/guanguans-laravel-soar)[misantron/dbunit

DbUnit fork supporting PHPUnit 10/11/12

121.2M6](/packages/misantron-dbunit)[zumba/mongounit

PHPUnit extension that supports mongodb

3198.6k1](/packages/zumba-mongounit)[code-distortion/adapt

A Laravel package that builds databases for your tests, improving their speed.

2835.5k](/packages/code-distortion-adapt)[sofa/eloquent-testsuite

Helpers for fast and reliable UNIT tests for your Eloquent Models with PHPUnit

10104.7k](/packages/sofa-eloquent-testsuite)

PHPackages © 2026

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