DBUnit alternatives and similar libraries
Based on the "Testing" category.
Alternatively, view DBUnit alternatives based on common mentions on social networks and blogs.
-
Mockery
Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). -
VFS Stream
vfsStream is a stream wrapper for a virtual file system that may be helpful in unit tests to mock the real file system. It can be used with any unit test framework, like PHPUnit or SimpleTest. -
PHP-Mock: mocking built-in PHP functions
Mock built-in PHP functions (e.g. time(), exec() or rand())
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of DBUnit or a related project?
Popular Comparisons
README
This extension is no longer maintained
DbUnit
PHPUnit extension for database interaction testing.
Installation
Composer
If you use Composer to manage the dependencies of your project then you can add DbUnit as a development-time dependency to your project:
$ composer require --dev phpunit/dbunit
PHP Archive (PHAR)
You can download a PHAR of DbUnit:
$ wget https://phar.phpunit.de/dbunit.phar
The example below shows how to configure PHPUnit to load all *.phar
files found in a given directory (tools/phpunit.d
in this example):
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.0/phpunit.xsd"
extensionsDirectory="tools/phpunit.d">
</phpunit>