davek1312/testing 问题修复 & 功能扩展

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

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

davek1312/testing

Composer 安装命令:

composer require --dev davek1312/testing

包简介

Testing helpers

README 文档

README

Testing helpers.

Installation

The package is available on Packagist, you can install it using Composer.

composer require davek1312/testing

Usage

Your test class should implement our TestClass class:

<?php

namespace Davek1312\Testing;

class YourTestCase extends \Davek1312\Testing\TestCase {

}

Database

Resetting The Database After Each Test It is often useful to reset your database after each test so that data from a previous test does not interfere with subsequent tests.

Using Migrations

One option is to rollback the database after each test and migrate it before the next test:

<?php

namespace Davek1312\Testing;

class YourTestCase extends \Davek1312\Testing\TestCase {
    
    use \Davek1312\Database\Testing\MakesDatabaseMigrations;
    
}

Using Transactions

Another option is to wrap every test case in a database transaction:

<?php

namespace Davek1312\Testing;

class YourTestCase extends \Davek1312\Testing\TestCase {
    
    use \Davek1312\Database\Testing\MakesDatabaseTransactions;
    
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固