承接 vi5tar/laravel-persistingdatabase 相关项目开发

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

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

vi5tar/laravel-persistingdatabase

Composer 安装命令:

composer require vi5tar/laravel-persistingdatabase

包简介

Setup data to persist throughout a test case.

README 文档

README

Latest Version on Packagist MIT Licensed GitHub Workflow Status Total Downloads

This package provides a trait that can be used on a Illuminate\Foundation\Testing\TestCase to setup data once for the tests in that TestCase.

Notice:

This is an alternative to Illuminate\Foundation\Testing\RefreshDatabase. Use one or the other depending on the needs of the tests.

Installation

Install via composer:

composer require vi5tar/laravel-persistingdatabase

Usage

use ArticleSeeder;
use PostSeeder;
use Tests\TestCase;
use Vi5tar\PersistingDatabase;

class ExampleTest extends TestCase
{
    use PersistingDatabase;

    public function setupDb(): void
    {
        $this->seed([
            ArticleSeeder::class,
            PostSeeder::class
        ]);
    }

    /**
     * A basic feature test example.
     *
     * @return void
     */
    public function articleIndexTest()
    {
        $response = $this->get('/articles');

        $response->assertStatus(200);
    }

    /**
     * A basic feature test example.
     *
     * @return void
     */
    public function postIndexTest()
    {
        $response = $this->get('/posts');

        $response->assertStatus(200);
    }
}

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固