定制 pdmfc/laravel-nova-test-assertions-php-8-support 二次开发

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

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

pdmfc/laravel-nova-test-assertions-php-8-support

Composer 安装命令:

composer require --dev pdmfc/laravel-nova-test-assertions-php-8-support

包简介

Laravel Nova testing helpers

README 文档

README

A collection of test assertions and helpers to assist you on testing Laravel Nova applications.

Packagist Downloads Packagist Version Packagist License

Installation

composer require pdmfc/laravel-nova-test-assertions --dev

Add the NovaTestAssertions trait to your tests or to the TestCase:

use Pdmfc\NovaTestAssertions\Traits\NovaTestAssertions;

class ExampleTest extends TestCase
{
    use NovaTestAssertions;
}

Test Example

class AssertionsTest extends TestCase
{
    /** @test */
    public function detail_view_has_id_field()
    {
        $this->actingAs($user = factory(User::class)->create());

        $response = $this->resourceDetail(UserResource::class, $user->id);

        $response->assertContainsField(ID::class);
    }

    /** @test */
    public function asserts_total_resources_available_on_index_view(): void
    {
        factory(User::class, 5)->create();

        $actual = $this->resourceCount(UserResource::class);

        $this->assertEquals(6, $actual);
    }

    /** @test */
    public function asserts_run_nova_action(): void
    {
        $user = factory(User::class)->create(['name' => 'Bar']);

        $this->runAction(FooAction::class, UserResource::class, $user->id);

        $this->assertEquals('Foo', $user->fresh()->name);
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固