PHPackages                             fhteam/laravel-phpunit - 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. fhteam/laravel-phpunit

ActiveLibrary

fhteam/laravel-phpunit
======================

A bunch of Laravel PHPUnit helpers

v1.1(8y ago)1492[1 issues](https://github.com/fhteam/laravel-phpunit/issues)GPL-2.0PHPPHP &gt;=5.5.0

Since Jan 19Pushed 7y ago5 watchersCompare

[ Source](https://github.com/fhteam/laravel-phpunit)[ Packagist](https://packagist.org/packages/fhteam/laravel-phpunit)[ RSS](/packages/fhteam-laravel-phpunit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (3)Used By (0)

Laravel-PHPUnit Helpers
=======================

[](#laravel-phpunit-helpers)

Metrics\_Version[![PHP version](https://camo.githubusercontent.com/bc177dda859a7c265a796f9c1bbf609e1170a641dd6e56de89e28f9309162c1e/68747470733a2f2f62616467652e667572792e696f2f70682f66687465616d2532466c61726176656c2d706870756e69742e737667)](http://badge.fury.io/ph/fhteam%2Flaravel-phpunit)Compatibility[![Laravel compatibility](https://camo.githubusercontent.com/dd58f710d3d14da6be76abb20b755b14fff099d7cca04f25d16292a4a97e1df4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d352d677265656e2e737667)](http://laravel.com/)Quality[![Code Climate](https://camo.githubusercontent.com/94127fb92e552730762e0bb17a6bd19b431fcdf70a12c60ed32c298aa365d9c3/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f66687465616d2f6c61726176656c2d706870756e69742f6261646765732f6770612e737667)](https://codeclimate.com/github/fhteam/laravel-phpunit)This small library contains some helpers for phpUnit.

Base features
-------------

[](#base-features)

TestBase class contains the following features:

- Setup application type you need to use when testing via `$appContract` property
- Setup bootstrap file path you need to use when testing via `$bootstrapPath` property
- Ability to use self-configuring traits

Self-configuring traits
-----------------------

[](#self-configuring-traits)

Base test class allows you to use automatically configuring traits. It works in the following way:

When test setUp method is called, traits are initialized first. If a trait has any special methods, they are called at the appropriate time. Suppose your test uses trait named `HiddenMembersTestTrait`. Then the following trait methods will be called on the test class instance:

- `beforeAppHiddenMembersTestTrait()` - before Laravel application is created
- `afterAppHiddenMembersTestTrait(Application $app)` - right after Laravel application is created, but before leaving phpUnit `setUp()` method

Testing private and protected members of your classes
-----------------------------------------------------

[](#testing-private-and-protected-members-of-your-classes)

WARNING: Testing an object's protected or private properties / methods is generally a bad idea. Use with caution.

If you need to test private or protected test members of your class, you can use HiddenMembersTestTrait in your test classes. It adds the following methods:

- `assertMembersEqual`. This method accepts an object and an associative array of object's expected property values and tests if all of the given expected property values equal to those of the object
- `assertMembersSame`. This is variant of the above, which tests for sameness instead of equality
- `getObjectProperties`. Just returns an array of object's requested properties with their values (disregarding visibility)
- `getMethodCallResult`. Returns a result of the method call (disregarding visibility)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~1 days

Total

2

Last Release

3039d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58b0dff9b71ea9cbee66a5995bebcc3d4fa429f603e2e515e56f929a67610f1e?d=identicon)[matyunin](/maintainers/matyunin)

![](https://www.gravatar.com/avatar/03352d49df0742377af31a8a2a838bb13f7b129bd1986dcfb92fd49b52de4c6f?d=identicon)[forumhouse](/maintainers/forumhouse)

---

Top Contributors

[![FractalizeR](https://avatars.githubusercontent.com/u/318489?v=4)](https://github.com/FractalizeR "FractalizeR (5 commits)")[![god1dog](https://avatars.githubusercontent.com/u/5496458?v=4)](https://github.com/god1dog "god1dog (3 commits)")[![matyunin](https://avatars.githubusercontent.com/u/1249544?v=4)](https://github.com/matyunin "matyunin (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/fhteam-laravel-phpunit/health.svg)

```
[![Health](https://phpackages.com/badges/fhteam-laravel-phpunit/health.svg)](https://phpackages.com/packages/fhteam-laravel-phpunit)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[laravel/browser-kit-testing

Provides backwards compatibility for BrowserKit testing in the latest Laravel release.

5139.4M286](/packages/laravel-browser-kit-testing)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2021.0M277](/packages/drupal-core-dev)[spatie/laravel-visit

Quickly visit any route of your Laravel app

15614.6k](/packages/spatie-laravel-visit)

PHPackages © 2026

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