bypikod/php-test 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

bypikod/php-test

最新稳定版本:1.0.1

Composer 安装命令:

composer create-project bypikod/php-test

包简介

Very simple testing library with PHP

README 文档

README

License Maintaned Commits Forks Stars Watchers

Simple PHP test library for unit testing.

Warning

Minimum PHP version for this package is PHP7.

Installation

Add this package to your project with composer:

composer require bypikod/php-test

Getting Started

Basic Test:

use PHPTest\Test;

Test::it("test", function (Test $test) {
    $test->assertEqual(1, 2);
});

Suite Test:

use PHPTest\Test;

Test::suite("test", function ($it) {
    $it("test", function (Test $test) {
        $test->assertEqual(1, 1);
    });
    $it("test", function (Test $test) {
        $test->assertEqual(1, 2);
    });
});

Suite Test with Class:

use PHPTest\Test;

class RouterTest extends Router
{
    /**
     * Test get branch
     * @test Branch Getter Test
     * @since 1.0.0
     */
    public function getBranchTest(Test $test): void
    {
        // Test get branch
        $this->getBranch('/a/b', false)[] = 'test';
        $test->assertArrayContains($this->getBranch('/a/b', false), 'test');
        // Test by popping the last element
        $this->getBranch('/a/b/test', true)[] = 'test';
        $test->assertArrayContains($this->getBranch('/a/b', false), 'test');
    }
}


$router = new RouterTest();
Test::suiteClass($router);

Contribute

Contributers are welcome! Just make sure you understand the follow the rules below:

  • Contributions must follow the PSR-2 coding standard.
  • Make sure you're writing documentation that covers your code changes.
  • Follow the Code of Conduct.

And you should know your submissions will be under MIT License.

License

This project is licensed under the terms of the MIT License.

You are free to use this project in compliance with the MIT License. If you decide to use, modify, or redistribute this software, you must include a copy of the original license and copyright notice in all copies or substantial portions of the software.

For more information about the MIT License, visit: MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固