定制 faissaloux/pest-plugin-math 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

faissaloux/pest-plugin-math

Composer 安装命令:

composer require --dev faissaloux/pest-plugin-math

包简介

Math plugin for Pest PHP

README 文档

README

This plugin affords math related expectations.

Tests Codecov Packagist Version Packagist License

Requirements

pest php pest-plugin-math
^2.0 ^8.1 ^1.0.0
^3.0 ^8.2 ^1.3.0
^4.0 ^8.3 ^1.5.0

toBeDivisibleBy()

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

toBePowerOf()

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

toBeMaxOf()

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

toBeMinOf()

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

toBeEven()

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

toBeOdd()

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

toBePrime()

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

toBePositive()

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

toBeNegative()

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

toBeSqrtOf()

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

toBeFactorialOf()

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

toBeAbsoluteOf()

$$\mid -3 \mid$$

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

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()

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

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()

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

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);

faissaloux/pest-plugin-math 适用场景与选型建议

faissaloux/pest-plugin-math 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 12, 最近一次更新时间为 2024 年 07 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「framework」 「php」 「testing」 「plugin」 「test」 「math」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 faissaloux/pest-plugin-math 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 faissaloux/pest-plugin-math 我们能提供哪些服务?
定制开发 / 二次开发

基于 faissaloux/pest-plugin-math 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-06