PHPackages                             granam/test-with-mockery - 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. granam/test-with-mockery

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

granam/test-with-mockery
========================

Mockery test helper ensuring mocked method exists

2.0.0(5y ago)047020MITPHPPHP &gt;=7.3

Since Nov 4Pushed 5y agoCompare

[ Source](https://github.com/granam/test-with-mockery)[ Packagist](https://packagist.org/packages/granam/test-with-mockery)[ Docs](https://github.com/granam/test-with-mockery)[ RSS](/packages/granam-test-with-mockery/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (6)Used By (20)

Mockery test helper
===================

[](#mockery-test-helper)

No more mocked non-existing methods after a method name change.

```
class MyTest extends \Granam\Tests\TestWithMockery {

    public function testMyClass() {
        $myClassMock = $this->mockery(Sos::class);
        $myClassMock->expects('saveMe') // saveMe() no more exists and \Granam\Tests\Exceptions\MockingOfNonExistingMethod is thrown
            ->andReturn(true);
    }
}

class Sos {

    // renamed previous saveMe()
    public function saveUs(): bool {
        return false;
    }
}
```

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

[](#installation)

```
composer require --dev granam/test-with-mockery
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity52

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 ~23 days

Total

5

Last Release

1929d ago

Major Versions

1.0.x-dev → 2.0.02021-02-04

PHP version history (2 changes)1.0.0PHP &gt;=7.1

2.0.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e35d11c9a75584084f0dc0ba1a3b6ff03355777809cbe8eabd20a88ac00f794?d=identicon)[jaroslavtyc](/maintainers/jaroslavtyc)

---

Top Contributors

[![jaroslavtyc](https://avatars.githubusercontent.com/u/2290225?v=4)](https://github.com/jaroslavtyc "jaroslavtyc (18 commits)")

---

Tags

phpstringmockeryobjectmethodensureexists

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/granam-test-with-mockery/health.svg)

```
[![Health](https://phpackages.com/badges/granam-test-with-mockery/health.svg)](https://phpackages.com/packages/granam-test-with-mockery)
```

###  Alternatives

[polishsymfonycommunity/symfony-mocker-container

Provides base Symfony dependency injection container enabling service mocking.

1468.0M237](/packages/polishsymfonycommunity-symfony-mocker-container)[php-mock/php-mock-mockery

Mock built-in PHP functions (e.g. time()) with Mockery. This package relies on PHP's namespace fallback policy. No further extension is needed.

392.1M96](/packages/php-mock-php-mock-mockery)[derptest/phpmachinist

Testing object factory for PHP

3636.9k1](/packages/derptest-phpmachinist)[phpmachinist/phpmachinist

Testing object factory for PHP

3630.7k](/packages/phpmachinist-phpmachinist)[polishsymfonycommunity/symfony2-mocker-extension

Behat extension for mocking services defined in the Symfony2 dependency injection container.

26253.1k4](/packages/polishsymfonycommunity-symfony2-mocker-extension)

PHPackages © 2026

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