定制 cable8mm/phpunit-start-kit 二次开发

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

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

cable8mm/phpunit-start-kit

Composer 安装命令:

composer require cable8mm/phpunit-start-kit

包简介

Phpunit Start Kit is the simple code for starting TDD

README 文档

README

code-style run-tests PHP Version Packagist Version Packagist Downloads Packagist License

A starter kit for creating PHP libraries with PHPUnit testing and modern development tools.

Requirements

  • PHP 8.3 or higher
  • Composer 2.0 or higher

Features

  • Pest Testing: Pre-configured Pest 4.x support with example tests
  • Code Linting: Laravel Pint for automatic code style enforcement
  • CI/CD Ready: GitHub Actions workflows for testing and code style
  • Auto CHANGELOG: Automatic changelog updates on GitHub releases
  • Modern PHP: PHP 8.3+ with strict types and PSR-4 autoloading
  • EditorConfig: Consistent coding styles across editors
  • Complete Documentation: README, CHANGELOG, and MIT License included

Installation

As a Template (Recommended)

Create a new project from this starter kit:

composer create-project cable8mm/phpunit-start-kit <package_name>
cd <package_name>

As a Dependency

composer require cable8mm/phpunit-start-kit

Quick Start

  1. Update package information in composer.json:

    • Change name to your package name (e.g., your-vendor/your-package)
    • Update authors information
    • Add your package dependencies
  2. Customize the source code:

    • Modify src/StartKit.php with your implementation
    • Update namespace to match your package
  3. Write tests:

    • Update tests/StartKitTest.php with your test cases
    • Add more test files as needed
  4. Update documentation:

    • Edit README.md with your project description
    • Update CHANGELOG.md with your release notes

Available Commands

# Run tests
composer test

# Check code style
composer inspect

# Fix code style automatically
composer lint

# Generate API documentation (requires doctum.phar)
composer apidoc

Project Structure

.
├── src/
│   └── StartKit.php          # Main source code
├── tests/
│   └── StartKitTest.php      # Test files
├── .github/
│   └── workflows/
│       ├── run-tests.yml     # Automated testing
│       ├── code-style.yml    # Code linting
│       └── update-changelog.yml  # Auto CHANGELOG updates
├── composer.json             # Package configuration
├── phpunit.xml               # PHPUnit configuration
├── .editorconfig             # Editor configuration
├── CHANGELOG.md              # Change log
└── README.md                 # Project documentation

GitHub Actions Workflows

This starter kit includes three pre-configured GitHub Actions:

  1. run-tests.yml: Runs tests on multiple PHP versions (8.2, 8.3, 8.4, 8.5)
  2. code-style.yml: Automatically fixes code style with Laravel Pint
  3. update-changelog.yml: Updates CHANGELOG.md when a new release is published

Testing

The kit includes example tests using Pest's elegant syntax:

test('it can be instantiated', function () {
    $startKit = new StartKit;

    expect($startKit)->toBeInstanceOf(StartKit::class);
});

Code Style

This project uses Laravel Pint for code styling, which follows PSR-12 standards with Laravel conventions.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

The PHPUnit Start Kit is open-sourced software licensed under the MIT license.

cable8mm/phpunit-start-kit 适用场景与选型建议

cable8mm/phpunit-start-kit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 33 次下载、GitHub Stars 达 5, 最近一次更新时间为 2020 年 05 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 cable8mm/phpunit-start-kit 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-14