← Retour aux projets
Pest Plugin Helpers Auto Register
This is now part of the PEST core and this plugin does not provide anymore value
#Register PEST helpers as a TestCase method.
#Getting started
#Installation
This library can be installed using composer, if you don't have it already, download it.
You can run this command :
composer require delights/pest-plugin-helpers-auto-register
#Usage
We do not support namespaced functions in
Helpers.php. However, as of PHP8 and this rfc this will be possible.
Once, you installed it, every function in your tests/Helpers.php file will be available as a method in your test case.
If a method and a helper have the same name, the method will be called.
// tests/Helpers.php function assertReallyEqual($a, $b) { $this->assertEquals($a, $b); $this->assertEquals($a, $b); } // tests/SomeTest.php it('tests') ->assertReallyEqual(1, 1); it('tests but better', function () { $this->assertReallyEqual(1, 1); });