承接 julesgraus/livewire-view-assertions 相关项目开发

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

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

julesgraus/livewire-view-assertions

最新稳定版本:1.0.3

Composer 安装命令:

composer require julesgraus/livewire-view-assertions

包简介

Adds extra assertions to Livewires tests to assert that things are bound in the view of components

README 文档

README

The current Laravel Livewire test functionalities for version 2 don't have assertions that allow you to check if a property or action form a Livewire component actually are bound to the view of a Laravel Livewire component.

With this package you'll get a couple of extra assertions you can use to do so. I've created a discussion and pull request too to the Livewire GitHub repository. So in the near feature, i hope that you can use these assertions directly from the Livewire package itself. Or just simply ask. I will then be abl

Installation instructions

Using composer: composer require julesgraus/livewire-view-assertions

Usage

In your tests, use the JulesGraus\LivewireViewAssertions\Livewire facade like so for example:

//Other imports here
use JulesGraus\LivewireViewAssertions\Livewire

class TestableLivewireViewBindingsTest extends TestCase
{
    public function test_asserts_all_properties_are_bound()
    {
        Livewire::test(SomeComponent::class)
            ->assertPropertyBound('foo')
            ->assertPropertyBound('bar', 2);
    }
}

Assertions overview

This package gives you the following assertions. If after reading their descriptions below, it still isn't clear on how to use them, please have a look at the tests in this package.

assertPropertyBound

Assert that a property is bound using a wire:model attribute in the blade template of the component.

The first parameter must be the name of the property you want to check. The second parameter checks how often the property must be bound. If you omit it or set it to null, it will check if it is at least bound once.

assertPropertyNotBound

Asserts that a property isn't bound using a wire:model attribute in the blade template of the component.

The first parameter must be the name of the property you want to check.

assertActionBound

Assert that an action is bound using a wire:[dispatched browser event] attribute in the blade template of the component.

The first parameter must be the name of the action you want to check. The second parameter checks how often the action must be bound. If you omit it or set it to null, it will check if it is at least bound once.

assertPropertyNotBound

Asserts that an action isn't bound using a wire:[dispatched browser event] attribute in the blade template of the component.

The first parameter must be the name of the action you want to check.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-03-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固