ajthinking / pest-plugin-testables
Easily test Builders
Fund package maintenance!
nunomaduro
Patreon
www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L
Requires
- php: ^7.3 || ^8.0
- pestphp/pest: ^1.0
- pestphp/pest-plugin: ^1.0
Requires (Dev)
- pestphp/pest-dev-tools: dev-master
This package is auto-updated.
Last update: 2024-11-22 17:03:21 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.