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). -
php-webdriver
PHP client for Selenium/WebDriver protocol. Previously facebook/php-webdriver -
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. -
Kahlan
:heavy_check_mark: PHP Test Framework for Freedom, Truth, and Justice -
AspectMock
The most powerful and flexible mocking framework for PHPUnit / Codeception. -
HTTP Mock
Mock HTTP requests on the server side in your PHP unit tests -
PHP-Mock: mocking built-in PHP functions
Mock built-in PHP functions (e.g. time(), exec() or rand()) -
Steward
PHP libraries that makes Selenium WebDriver + PHPUnit functional testing easy and robust
Collect and Analyze Billions of Data Points in Real Time
* 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>