ajthinking/pest-plugin-testables

Easily test Builders

v0.0.2 2022-01-22 10:46 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT f140c42443e7b0e99ffe50b702dd9674d61a9a35

frameworkphptestingplugintestunitpest

This package is auto-updated.

Last update: 2026-06-22 20:25:30 UTC


README

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.