PHPackages                             rzajac/php-test-helper - 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. rzajac/php-test-helper

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

rzajac/php-test-helper
======================

Classes helping with unit tests

2.0.3(8y ago)09.0kApache-2.0PHPPHP &gt;=7.0

Since Nov 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/rzajac/php-test-helper)[ Packagist](https://packagist.org/packages/rzajac/php-test-helper)[ RSS](/packages/rzajac-php-test-helper/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (39)Used By (0)

PHP Test helper classes.
------------------------

[](#php-test-helper-classes)

Unit testing helper.

What does it help with?
-----------------------

[](#what-does-it-help-with)

- Load database fixtures (`sql`).
- Load file fixtures (`json`, `txt`, `php`).
- Tests where you interact with database.
- Database helper methods [see database interface](src/Database/DbItf.php).

Supported databases.
--------------------

[](#supported-databases)

- MySQL

Install.
--------

[](#install)

```
{
    "require": {
        "rzajac/php-test-helper": "^2.0"
    }
}
```

Run unit tests.
---------------

[](#run-unit-tests)

Yes! The package has it's own unit tests.

```
$ vendor/bin/phpunit --coverage-html=./coverage

```

Setup database for unit tests.
------------------------------

[](#setup-database-for-unit-tests)

### MySQL.

[](#mysql)

Create test users and database tables:

```
CREATE DATABASE testHelper1 DEFAULT CHARACTER SET = 'utf8' DEFAULT COLLATE = 'utf8_general_ci';
CREATE DATABASE testHelper2 DEFAULT CHARACTER SET = 'utf8' DEFAULT COLLATE = 'utf8_general_ci';

CREATE USER 'testUser'@'localhost' IDENTIFIED BY 'testUserPass';
CREATE USER 'testUser'@'%' IDENTIFIED BY 'testUserPass';
GRANT ALL ON `testHelper1`.* TO 'testUser'@'localhost';
GRANT ALL ON `testHelper2`.* TO 'testUser'@'localhost';
GRANT ALL ON `testHelper1`.* TO 'testUser'@'%';
GRANT ALL ON `testHelper2`.* TO 'testUser'@'%';
FLUSH PRIVILEGES;
```

Run tests:

```
$ vendor/bin/phpunit

```

When you have XDebug enabled running unit tests creates coverage report in `coverage` directory.

Loading time zone tables.
-------------------------

[](#loading-time-zone-tables)

`$ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p`

License.
--------

[](#license)

Apache License Version 2.0

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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 ~22 days

Recently: every ~85 days

Total

39

Last Release

3025d ago

Major Versions

0.7.2 → 1.0.02017-03-07

1.5.0 → 2.0.02018-02-09

PHP version history (2 changes)0.3.5PHP &gt;=5.5

2.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4cb2ea487c919ad2c3af67add86e6e342f2e7794e7c42215301d7523f5f93725?d=identicon)[rzajac](/maintainers/rzajac)

---

Top Contributors

[![rzajac](https://avatars.githubusercontent.com/u/203696?v=4)](https://github.com/rzajac "rzajac (80 commits)")

---

Tags

testingunit test

### Embed Badge

![Health badge](/badges/rzajac-php-test-helper/health.svg)

```
[![Health](https://phpackages.com/badges/rzajac-php-test-helper/health.svg)](https://phpackages.com/packages/rzajac-php-test-helper)
```

###  Alternatives

[phpunit/phpunit

The PHP Unit Testing framework.

20.0k940.0M150.4k](/packages/phpunit-phpunit)[phpunit/php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.

8.9k921.0M1.6k](/packages/phpunit-php-code-coverage)[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k516.1M26.2k](/packages/mockery-mockery)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k100.2M2.1k](/packages/behat-behat)[behat/mink

Browser controller/emulator abstraction for PHP

1.6k88.9M669](/packages/behat-mink)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k41.3M39.0k](/packages/orchestra-testbench)

PHPackages © 2026

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