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)2749[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 1mo ago

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 14% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

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

3855d 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

[phpunit/phpunit

The PHP Unit Testing framework.

20.0k910.7M134.8k](/packages/phpunit-phpunit)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[johnkary/phpunit-speedtrap

Find and report on slow tests in your PHPUnit test suite

78337.2M122](/packages/johnkary-phpunit-speedtrap)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69617.9M510](/packages/spatie-phpunit-snapshot-assertions)[dg/bypass-finals

Removes final keyword from source code on-the-fly and allows mocking of final methods and classes

57026.3M456](/packages/dg-bypass-finals)[phpspec/prophecy-phpunit

Integrating the Prophecy mocking library in PHPUnit test cases

19454.9M1.4k](/packages/phpspec-prophecy-phpunit)

PHPackages © 2026

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