承接 robier/tests-ignore-final 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

robier/tests-ignore-final

Composer 安装命令:

composer require robier/tests-ignore-final

包简介

Mock final classes

README 文档

README

This library allows you to mock classes that have final keyword in their signature. This is accomplished by hooking up into autoload process and changing source code of the class on the fly.

This library was inspired by dg/bypass-finals library. I wanted to have same functionally but with different approach. I hope that this different approach will not have the same problems as dg/bypass-finals have with infection.

Usage

Let's say you have this class that you want to mock:

<?php # ./FooBar.php final class FooBar { }

Only thing what you need to do in your test is this:

<?php use PHPUnit\Framework\TestCase; use Robier\Tests\IgnoreFinal; class FooBarTest extends TestCase { public function testSomething(): void { IgnoreFinal::composer(FooBar::class); } }

Class IgnoreFinal will find the source code of the class we want to mock, and it will remove all final keywords from source code and load that modified source code instead of real one.

Tests

First run docker/build to build a container and then docker/run composer run test for running all tests.

Contribution

Feel free to contribute!

统计信息

  • 总下载量: 8.86k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固