PHPackages                             kaingnx/visible-unit - 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. kaingnx/visible-unit

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

kaingnx/visible-unit
====================

Simplified unit testing on non-visible properties and methods.

12PHPCI failing

Since Oct 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/KainGNX/visible-unit)[ Packagist](https://packagist.org/packages/kaingnx/visible-unit)[ RSS](/packages/kaingnx-visible-unit/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Visible Unit
============

[](#visible-unit)

Simplified unit testing on non-visible properties and methods. This repository is intended for development use only, since its main purpose is to bypass class visibility in unit testing.

### Usage

[](#usage)

Run `composer require --dev kaingnx/visible-unit`

#### Unit Testing

[](#unit-testing)

```
// src/Your/Path/ExampleUnitTest.php
namespace Your\Namespace\Test;

use VisibleUnit\Reflections\BaseReflection;
use Your\Namespace\YourObject;

class ExampleUnitTest
{
    /**
     * Set Up
     *
     * @return void
     */
    public function setUp()
    {
        $this->yourObject = new YourObject();
        $this->mockReflection = new BaseReflection($this->yourObject);
    }

    /**
     * Test Example Prop and Method
     *
     * @return void
     */
    public function testExamplePropAndMethod()
    {
        $this->mockReflection->invokeMethod('privateOrProtectedMethod');
        $privateOrProtectedProp = $this->mockReflection->getPropValue('privateOrProtectedProp');
    }
}
```

##### More Info

[](#more-info)

See source of:

- `src/Reflections/BaseReflection.php`
- `tests/TestCase/Reflections/BaseReflectionTest.php`
- `tests/TestClass/MockAccessObject.php`

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d48ff23d0d44060563bc1bfbdb0c1f3b6ac6305a2158273e5792bfba585c5df?d=identicon)[jhorvath](/maintainers/jhorvath)

### Embed Badge

![Health badge](/badges/kaingnx-visible-unit/health.svg)

```
[![Health](https://phpackages.com/badges/kaingnx-visible-unit/health.svg)](https://phpackages.com/packages/kaingnx-visible-unit)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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