PHPackages                             kodeas/publicise - 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. kodeas/publicise

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

kodeas/publicise
================

Publicise lets you test the `private` or `protected` properties and methods in your classes

1.0.2(4y ago)15.1k↓37.9%MITPHPPHP ^8.0

Since Jul 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Kodeas/publicise)[ Packagist](https://packagist.org/packages/kodeas/publicise)[ Docs](https://github.com/kodeas/publicise)[ GitHub Sponsors](https://github.com/Kodeas)[ RSS](/packages/kodeas-publicise/feed)WikiDiscussions main Synced 1mo ago

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

[![Publicise](https://user-images.githubusercontent.com/9021386/125131576-a4296c00-e10b-11eb-88ac-e367c7987eed.png)](https://user-images.githubusercontent.com/9021386/125131576-a4296c00-e10b-11eb-88ac-e367c7987eed.png)

Publicise
=========

[](#publicise)

[![Latest Version](https://camo.githubusercontent.com/0908fa25bdad641956c38ac39bbc34fc8ac5f921f94cd88867076d8624f3e788/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6b6f646561732f7075626c69636973652e7376673f7374796c653d666c61742d737175617265)](https://github.com/kodeas/publicise/releases)[![Tests](https://github.com/kodeas/publicise/workflows/Tests/badge.svg)](https://github.com/kodeas/publicise/workflows/Tests/badge.svg)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/10162999c450cefd1dc4e8c3953745b9a0fb643bf4837aabef49f2578b467411/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6b6f646561732f7075626c69636973652f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/kodeas/publicise/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/586a57aa85099ef30a6df52570e6bac5d76721c5376c5756bd3863b82a34db0f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6f646561732f7075626c69636973652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kodeas/publicise)

---

Publicise lets you test the `private` or `protected` properties and methods in your classes. Behind the scenes, it utilises PHP's ReflectionClass and offers a more readable api.

It is particularly useful for testing Fluent Interfaces.

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

[](#installation)

You can install the package via composer:

```
composer require kodeas/publicise
```

Usage
-----

[](#usage)

First, in your Test file or TestCase class, import the trait.

```
use Kodeas\Publicise\WithPublicise;
use PHPUnit\Framework\TestCase;

class PubliciseTest extends TestCase
{
    use WithPublicise;
}
```

Then, you can reflect any class using `$this->publicise()`

```
/** @test */
public function can_call_private_method()
{
    $publicisedClass = $this->publicise(new YourClass());

    $publicisedClass->privateMethod();
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [kodeas](https://github.com/Kodeas)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% 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 ~0 days

Total

3

Last Release

1774d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/34669c21c80712dca2f3ec3d8a09754533994e81c875a74b8982dcd0cb9113a9?d=identicon)[kodeas](/maintainers/kodeas)

---

Top Contributors

[![sentiasa](https://avatars.githubusercontent.com/u/9021386?v=4)](https://github.com/sentiasa "sentiasa (9 commits)")[![SalihBorucu](https://avatars.githubusercontent.com/u/56773461?v=4)](https://github.com/SalihBorucu "SalihBorucu (1 commits)")

---

Tags

Kodeaspublicise

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kodeas-publicise/health.svg)

```
[![Health](https://phpackages.com/badges/kodeas-publicise/health.svg)](https://phpackages.com/packages/kodeas-publicise)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[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)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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