PHPackages                             fkupper/private-sniffer-module - 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. fkupper/private-sniffer-module

ActiveCodeception-module[Testing &amp; Quality](/categories/testing)

fkupper/private-sniffer-module
==============================

Simple module that enables sniffing into private defined elements of an object while running unit tests with Codeception.

0.1.1(6y ago)1186.2k—2.9%MITPHPPHP &gt;=7.1.0

Since Jul 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/fkupper/private-sniffer-module)[ Packagist](https://packagist.org/packages/fkupper/private-sniffer-module)[ RSS](/packages/fkupper-private-sniffer-module/feed)WikiDiscussions master Synced 1mo ago

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

Private Sniffer
===============

[](#private-sniffer)

[![Total Downloads](https://camo.githubusercontent.com/6aee7504ccdcd5320c65cf5b1bf69aee57c628778f83f590d6b273fbce9d712d/68747470733a2f2f706f7365722e707567782e6f72672f666b75707065722f707269766174652d736e69666665722d6d6f64756c652f646f776e6c6f616473)](//packagist.org/packages/fkupper/private-sniffer-module)[![Monthly Downloads](https://camo.githubusercontent.com/f0ba0af96ff557b50d02b44d9f8db98b06512c1af369529cda3f65a775cfa5eb/68747470733a2f2f706f7365722e707567782e6f72672f666b75707065722f707269766174652d736e69666665722d6d6f64756c652f642f6d6f6e74686c79)](//packagist.org/packages/fkupper/private-sniffer-module)

Simple Codeception module to check private elements of objects.

Installation
============

[](#installation)

Can be installed using composer:

```
composer require --dev fkupper/private-sniffer-module

```

Usage
=====

[](#usage)

Simple include the module on your unit suite config YML file:

```
modules:
   enabled: [PrivateSniffer]
```

On your unit tests you can now inspect and test private attributes and methods:

```
class Foo
{
    private $someInt = 1;

    private sum(int $a, int $b): int
    {
        return $a + $b;
    }
}

class TestFoo extends \Codeception\Test\Unit
{
    /**
     * @var \UnitTester
     */
    protected $tester;

    // tests
    public function testSum()
    {
        $foo = new Foo();

        // get the value of the private attribute $someInt
        $someInt = $this->tester->getPrivatePropertyValue($foo, 'someInt');
        $this->assertEquals(1, $someInt);

        // get a closure of the private method sum
        $sum = $this->tester->getPrivateMethod($foo, 'sum');
        $this->assertEquals(2 + 3, $sum(2, 3));
    }
}
```

Is this a solution to test bad/not testable code?
=================================================

[](#is-this-a-solution-to-test-badnot-testable-code)

Of course not. This is meant to be used when critical and sentive part of your code must be tested and is not possible for any reason.

Best practice still is to develop with unit testing in mind and refactor over time whatever you have that cannot be tested properly.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~40 days

Total

2

Last Release

2463d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/599fb5c824458d0e5cb099f6b83f0bd158c1c094f5d52821784f437ecf849741?d=identicon)[fernando.kupper](/maintainers/fernando.kupper)

---

Top Contributors

[![fkupper](https://avatars.githubusercontent.com/u/10757561?v=4)](https://github.com/fkupper "fkupper (7 commits)")

---

Tags

codeception-moduleunit-testing

### Embed Badge

![Health badge](/badges/fkupper-private-sniffer-module/health.svg)

```
[![Health](https://phpackages.com/badges/fkupper-private-sniffer-module/health.svg)](https://phpackages.com/packages/fkupper-private-sniffer-module)
```

###  Alternatives

[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)[lucatume/wp-browser

A set of Codeception modules to test WordPress projects.

6343.8M153](/packages/lucatume-wp-browser)[codeception/module-asserts

Codeception module containing various assertions

8550.6M1.2k](/packages/codeception-module-asserts)[codeception/lib-innerbrowser

Parent library for all Codeception framework modules and PhpBrowser

8641.7M77](/packages/codeception-lib-innerbrowser)[codeception/module-symfony

Codeception module for Symfony framework

949.4M95](/packages/codeception-module-symfony)[captbaritone/mailcatcher-codeception-module

Test emails in your Codeception acceptance tests

1114.5M10](/packages/captbaritone-mailcatcher-codeception-module)

PHPackages © 2026

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