PHPackages                             faissaloux/pest-plugin-math - 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. [Framework](/categories/framework)
4. /
5. faissaloux/pest-plugin-math

ActiveLibrary[Framework](/categories/framework)

faissaloux/pest-plugin-math
===========================

Math plugin for Pest PHP

v1.6.0(5mo ago)12102MITPHPPHP ^8.1CI passing

Since Jul 7Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/faissaloux/pest-plugin-math)[ Packagist](https://packagist.org/packages/faissaloux/pest-plugin-math)[ Fund](https://paypal.me/faissaloux)[ GitHub Sponsors](https://github.com/faissaloux)[ RSS](/packages/faissaloux-pest-plugin-math/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (8)Used By (0)

PEST PLUGIN MATH
================

[](#pest-plugin-math)

This plugin affords math related expectations.

[![Tests](https://github.com/faissaloux/pest-plugin-math/actions/workflows/tests.yml/badge.svg)](https://github.com/faissaloux/pest-plugin-math/actions/workflows/tests.yml) [![Codecov](https://camo.githubusercontent.com/7b8cdf7d372bc25ba9df499c92dce291c08a901c9acfd7c2852e9adba55ffa9b/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6661697373616c6f75782f706573742d706c7567696e2d6d617468)](https://camo.githubusercontent.com/7b8cdf7d372bc25ba9df499c92dce291c08a901c9acfd7c2852e9adba55ffa9b/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6661697373616c6f75782f706573742d706c7567696e2d6d617468) [![Packagist Version](https://camo.githubusercontent.com/0abd56c0193171bfec5e525f6ce9b74f3bee892da1b1615f0de7e8242b25e81f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6661697373616c6f75782f706573742d706c7567696e2d6d617468)](https://camo.githubusercontent.com/0abd56c0193171bfec5e525f6ce9b74f3bee892da1b1615f0de7e8242b25e81f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6661697373616c6f75782f706573742d706c7567696e2d6d617468) [![Packagist License](https://camo.githubusercontent.com/dc4ec860b189038d90a2e82debd86e254e7db149482e2c1e654a882f858579bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6661697373616c6f75782f706573742d706c7567696e2d6d617468)](https://camo.githubusercontent.com/dc4ec860b189038d90a2e82debd86e254e7db149482e2c1e654a882f858579bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6661697373616c6f75782f706573742d706c7567696e2d6d617468)

Requirements
------------

[](#requirements)

pestphppest-plugin-math^2.0^8.1^1.0.0^3.0^8.2^1.3.0^4.0^8.3^1.5.0#### `toBeDivisibleBy()`

[](#tobedivisibleby)

```
    expect(8)->toBeDivisibleBy(4);
    expect(8)->not->toBeDivisibleBy(3);
```

#### `toBePowerOf()`

[](#tobepowerof)

```
    expect(4096)->toBePowerOf(8);
    expect(128)->not->toBePowerOf(3);
```

#### `toBeMaxOf()`

[](#tobemaxof)

```
    expect(6)->toBeMaxOf([-6, 0, 6]);
    expect(5.5)->not->toBeMaxOf([2, 4.2, 5.5, 6]);
```

#### `toBeMinOf()`

[](#tobeminof)

```
    expect(-6)->toBeMinOf([-6, 0, 1]);
    expect(5.5)->not->toBeMinOf([2, 4.2, 5.5, 6]);
```

#### `toBeEven()`

[](#tobeeven)

```
    expect(6)->toBeEven();
    expect(7)->not->toBeEven();
```

#### `toBeOdd()`

[](#tobeodd)

```
    expect(7)->toBeOdd();
    expect(6)->not->toBeOdd();
```

#### `toBePrime()`

[](#tobeprime)

```
    expect(3)->toBePrime();
    expect(6)->not->toBePrime();
```

#### `toBePositive()`

[](#tobepositive)

```
    expect(1)->toBePositive();
    expect(-2)->not->toBePositive();
```

#### `toBeNegative()`

[](#tobenegative)

```
    expect(-1)->toBeNegative();
    expect(2)->not->toBeNegative();
```

#### `toBeSqrtOf()`

[](#tobesqrtof)

```
    expect(3)->toBeSqrtOf(9);
    expect(3.16)->toBeSqrtOf(10, 2);
    expect(2)->not->toBeSqrtOf(9);
```

#### `toBeFactorialOf()`

[](#tobefactorialof)

```
    expect(6)->toBeFactorialOf(3);
    expect(4)->not->toBeFactorialOf(2);
```

#### `toBeAbsoluteOf()`

[](#tobeabsoluteof)

$$\\mid -3 \\mid$$

```
    expect(3)->toBeAbsoluteOf(-3);
    expect(-3)->not->toBeAbsoluteOf(-3);
```

#### `toBeLogarithmOf()`

[](#tobelogarithmof)

$$\\log\_{base}(number)$$
Base default is euler's number.

```
    expect(0.69897000433602)->toBeLogarithmOf(number: 5, base: 10);
    expect(1)->not->toBeLogarithmOf(number: 1);
```

#### `toBeSumOf()`

[](#tobesumof)

```
    expect(6)->toBeSumOf([1, 2, 3]);
    expect(4)->not->toBeSumOf([2, 3]);
```

#### `toBeSummationOf()`

[](#tobesummationof)

$$\\sum\\limits\_n^k x \* 2$$

```
    expect(2)->toBeSummationOf(fn (int $x) => $x * 2, from: 0, to: 1);
    expect(3)->not->toBeSummationOf(fn (int $x) => $x * 2, from: 0, to: 1);
```

#### `toBeProdOf()`

[](#tobeprodof)

```
    expect(6)->toBeProdOf([1, 2, 3]);
    expect(4)->not->toBeProdOf([2, 3]);
```

#### `toBeProductOf()`

[](#tobeproductof)

$$\\prod\\limits\_n^k x \* 2$$

```
    expect(3715891200)->toBeProductOf(fn (int $x) => $x * 2, from: 1, to: 10);
    expect(1)->not->toBeProductOf(fn (int $x) => $x * 2, from: 1, to: 10);
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance70

Regular maintenance activity

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.3% 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 ~83 days

Recently: every ~119 days

Total

7

Last Release

176d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de77e6723e4e70d2e831fd775e7c8bb4ad2347c599d808ab0ee3c5141bdd0655?d=identicon)[faissaloux](/maintainers/faissaloux)

---

Top Contributors

[![faissaloux](https://avatars.githubusercontent.com/u/60013703?v=4)](https://github.com/faissaloux "faissaloux (109 commits)")[![Katalam](https://avatars.githubusercontent.com/u/39590058?v=4)](https://github.com/Katalam "Katalam (25 commits)")

---

Tags

pestpestphptestingphpplugintestingunitframeworktestpestmath

###  Code Quality

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/faissaloux-pest-plugin-math/health.svg)

```
[![Health](https://phpackages.com/badges/faissaloux-pest-plugin-math/health.svg)](https://phpackages.com/packages/faissaloux-pest-plugin-math)
```

###  Alternatives

[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)[pestphp/pest-plugin-livewire

The Pest Livewire Plugin

635.6M544](/packages/pestphp-pest-plugin-livewire)[pestphp/pest-plugin-faker

The Pest Faker Plugin

376.4M206](/packages/pestphp-pest-plugin-faker)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)[spatie/pest-plugin-route-testing

Make sure all routes in your Laravel app are ok

13753.8k](/packages/spatie-pest-plugin-route-testing)[milroyfraser/pest-plugin-gwt

Given When Then(GWT) Plugin for Pest

10332.1k1](/packages/milroyfraser-pest-plugin-gwt)

PHPackages © 2026

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