PHPackages                             phpnomad/tests - 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. phpnomad/tests

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

phpnomad/tests
==============

Testing library for PHPNomad

0.4.0(2mo ago)04.6k↑175%[2 PRs](https://github.com/phpnomad/tests/pulls)20proprietaryPHPCI failing

Since Oct 5Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/phpnomad/tests)[ Packagist](https://packagist.org/packages/phpnomad/tests)[ Docs](https://github.com/phpnomad/tests)[ RSS](/packages/phpnomad-tests/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (12)Versions (8)Used By (20)

phpnomad/tests
==============

[](#phpnomadtests)

[![Latest Version](https://camo.githubusercontent.com/a883bb0db46d3d1251930c1c71ed1648a53aec36e932d9bf2188fb60e81689b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f74657374732e737667)](https://packagist.org/packages/phpnomad/tests)[![Total Downloads](https://camo.githubusercontent.com/e6f479c2c840247e1f7d69b8cd541c593d796442af09a16d3b8dc8f6a72a4a61/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f74657374732e737667)](https://packagist.org/packages/phpnomad/tests)[![PHP Version](https://camo.githubusercontent.com/5bf54c55716de19e3c56b7f44c4af91f0985220f737d2c2f3a488eeccc85e18e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f74657374732e737667)](https://packagist.org/packages/phpnomad/tests)[![License](https://camo.githubusercontent.com/e5ae27dbfbf07a7f8fb983ede43499ac8bf3b20a97ac3db956250293cd44656a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f74657374732e737667)](https://packagist.org/packages/phpnomad/tests)

`phpnomad/tests` is the shared PHPUnit base that PHPNomad packages use for their own unit tests. It provides a `TestCase` wired up with Mockery-PHPUnit integration and two reflection traits for reaching into protected or private state. If you're writing application code against PHPNomad, you don't need this package. If you're contributing to a PHPNomad package, its `tests/` directory almost certainly already depends on it.

Installation
------------

[](#installation)

```
composer require --dev phpnomad/tests
```

Pull it in as a dev dependency only. It isn't meant for production code paths.

What's included
---------------

[](#whats-included)

- `PHPNomad\Tests\TestCase` extends `PHPUnit\Framework\TestCase` and mixes in `MockeryPHPUnitIntegration`, so Mockery expectations are verified and containers cleaned up automatically between tests.
- `PHPNomad\Tests\Traits\WithInaccessibleMethods` provides `callInaccessibleMethod()` for invoking protected or private methods through reflection.
- `PHPNomad\Tests\Traits\WithInaccessibleProperties` provides `getProtectedProperty()`, `getProtectedPropertyValue()`, and `setProtectedProperty()` for reading and writing protected or private properties through reflection.

Usage pattern
-------------

[](#usage-pattern)

Each PHPNomad package defines its own package-local `TestCase` that extends the shared one. That gives the package its own namespace root under `Tests/` while inheriting the PHPUnit and Mockery plumbing.

```
