fangx/testing-migration-command 问题修复 & 功能扩展

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

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

fangx/testing-migration-command

Composer 安装命令:

composer require fangx/testing-migration-command

包简介

testing migration commands

关键字:

README 文档

README

Laravel 默认的迁移命令只能执行第一层目录下的迁移文件, 本扩展支持多层目录 应用场景是在进行单元测试的时候, 可以自动执行所有的迁移文件

Install

Via Composer

composer require fangx/testing-migration-command --dev

Usage

在所有的 migrate 命令前加上 testing- 即可调用本扩展改写的 migrate 命令, 如:

php artisan testing-migrate
php artisan testing-migrate:rollback

在 tests/TestCase.php 中添加以下代码, 自动替换单测中的 migrate 相关命令

namespace Tests;

use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Str;

abstract class TestCase extends BaseTestCase
{
    // ...others

    public function artisan($command, $parameters = [])
    {
        if (Str::startsWith($command, ['migrate', 'migration'])) {
            $command = 'testing-' . $command;
        }

        return parent::artisan($command, $parameters);
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固