ajthinking/pest-plugin-testables

Easily test Builders
5
Install
composer require ajthinking/pest-plugin-testables
Latest Version:v0.0.2
PHP:^7.3 || ^8.0
License:MIT
Last Updated:Jan 22, 2022
Links: GitHub  ·  Packagist
Maintainer: ajthinking

Installation

composer require ajthinking/pest-plugin-testables --dev

Usage

test('it ignores excessive substraction', function() {
    testable(Inventory::class)
        ->setCount(1)
        ->substract(10)
        ->getCount()->assertEquals(0)
        ->add(2)
        ->getCount()->assertEquals(2)
});

How it works:

  • Provide testable with an instance or a resolvable classname.
  • Make preparatory calls as needed.
  • Reach for the property or method you want to assert against.
  • State the assertion. It will target the most recent operation.
  • After an assertion, it will return to the state before the assertion target, making it possible to chain more assertions.

Related Packages

pestphp/pest-plugin-agent

AI agent verification plugin for Pest

31 2
nekofar/pest-plugin-mock-client

Pest Plugin for Mock HTTP client

22 1
quadraecom/pest-plugin-selectors

Add CSS selector-based testing capabilities to Pest

2,035 1
pestphp/pest-plugin-type-coverage

The Type Coverage plugin for Pest PHP.

4,699,738 35