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 2w 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://avatars.githubusercontent.com/u/211489?v=4)[Jan Horvath](/maintainers/jhorvath)[@jhorvath](https://github.com/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

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14228.7M341](/packages/dms-phpunit-arraysubset-asserts)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

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