PHPackages                             gomoob/php-embedded-mongo - 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. gomoob/php-embedded-mongo

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

gomoob/php-embedded-mongo
=========================

Start an embedded Mongo DB server and run your PHPUnit integration tests easily.

0.0.1-alpha2(10y ago)4749[7 issues](https://github.com/gomoob/php-embedded-mongo/issues)MITJavaScriptPHP &gt;=5.3.3

Since Oct 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/gomoob/php-embedded-mongo)[ Packagist](https://packagist.org/packages/gomoob/php-embedded-mongo)[ RSS](/packages/gomoob-php-embedded-mongo/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (10)Versions (4)Used By (0)

php-embedded-mongo
==================

[](#php-embedded-mongo)

> Start an embedded Mongo DB server and run your PHPUnit integration tests easily.

[![Total Downloads](https://camo.githubusercontent.com/22a407aaabdac4f63f43f7b2c05397cc36fcfaf523fa69911cc3dc0b5cba7865/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f6d6f6f622f7068702d656d6265646465642d6d6f6e676f2e7376673f7374796c653d666c6174)](https://packagist.org/packages/gomoob/php-embedded-mongo)[![Latest Stable Version](https://camo.githubusercontent.com/13dbf25bf9aa7060ebde35d96415aa388b69d274ed48a4cd35d6192cbaabe0a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f6d6f6f622f7068702d656d6265646465642d6d6f6e676f2e7376673f7374796c653d666c6174)](https://packagist.org/packages/gomoob/php-embedded-mongo)[![Build Status](https://camo.githubusercontent.com/3fe5b6518bbae4759eb64e7d1e89e547e9e0eb14674da1ff56a8c31e6005ef67/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f676f6d6f6f622f7068702d656d6265646465642d6d6f6e676f2e7376673f7374796c653d666c6174)](https://travis-ci.org/gomoob/php-embedded-mongo)[![Coverage](https://camo.githubusercontent.com/fbf98a712d73da889d42debb7a0c408cb15922702598410f48684a2cdc2e3835/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f676f6d6f6f622f7068702d656d6265646465642d6d6f6e676f2e7376673f7374796c653d666c6174)](https://coveralls.io/r/gomoob/php-embedded-mongo?branch=master)[![Code Climate](https://camo.githubusercontent.com/a40860f1e876ed41ca3e70841cbd0b601f8997675eb7e63c17829c9ce9cb97fb/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f676f6d6f6f622f7068702d656d6265646465642d6d6f6e676f2e7376673f7374796c653d666c6174)](https://codeclimate.com/github/gomoob/php-embedded-mongo)[![License](https://camo.githubusercontent.com/4700ccc42db25ad352b203bf491790f574aaf61604cfbbab67bd8328ca0edf6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f676f6d6f6f622f7068702d656d6265646465642d6d6f6e676f2e7376673f7374796c653d666c6174)](https://packagist.org/packages/gomoob/php-embedded-mongo)

Writing integration tests using Mongo DB and PHP should be easy (it is in Java), this library allows you to quickly start an embedded Mongo DB server before running your tests.

Install
-------

[](#install)

The library starts a real Mongo DB server so you must have Java installed, then install the library using composer.

```
composer install --save-dev php-embedded-mongo

```

Quick sample
------------

[](#quick-sample)

```
// Create and starts an embedded Mongo DB server
$mongoServer = new MongoServer();
$mongoServer->start();

...

// Execute your PHPUnit tests

...

// Stops ths embedded Mongo DB server
$mongoServer->stop();
```

Easy, isn't it ?

Notes
-----

[](#notes)

This library is not complete neither stable, if you want us to improve it feel free to post a Github issue.

Here are important things to know about the behavior of the server :

- For now port numbers are not configurable, 2 ports are used `4309` and `27017` and must be free ;
- Port `27017` is used by the Mongo DB process (remember the library uses a real Mongo server) ;
- Port `4309` allows to send commands to a Java process which drives the Mongo DB process ;
- Log outputs location is not configurable, it default to `output.log`.

Release history
---------------

[](#release-history)

0.0.1-alpha2 (2015-10-29)
-------------------------

[](#001-alpha2-2015-10-29)

- First very basic UNIX support.

0.0.1-alpha1 (2015-10-28)
-------------------------

[](#001-alpha1-2015-10-28)

- First alpha version.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

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

3901d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4852e6f187378c657f58d61a19e474105855a236b23255204baf14218c5c657f?d=identicon)[bgaillard](/maintainers/bgaillard)

![](https://www.gravatar.com/avatar/22dd33f77ada75e74bcd51e4a573d8ad99d13586c8220c5c5eb9228fc5eb3b03?d=identicon)[simonbaudry](/maintainers/simonbaudry)

---

Top Contributors

[![bgaillard](https://avatars.githubusercontent.com/u/1327782?v=4)](https://github.com/bgaillard "bgaillard (6 commits)")

---

Tags

phpunitmongoembeddedgomoobIn Memory

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/gomoob-php-embedded-mongo/health.svg)

```
[![Health](https://phpackages.com/badges/gomoob-php-embedded-mongo/health.svg)](https://phpackages.com/packages/gomoob-php-embedded-mongo)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[illuminate/log

The Illuminate Log package.

6225.3M622](/packages/illuminate-log)

PHPackages © 2026

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