Limited-Time Special Use Code to Get 30% Off Your First Buying EduBank. Find out more!
Nuno Maduro announced on X that Pest v2.16 is now out. This update comes packed with native functions support on the arch plugin, fresh expectations, and more. Here is a quick example of the new features:
expect(['die', 'eval', 'sleep'])->not->toBeUsed();
expect('abcDef')->toBeCamelCase();
expect('abc-def')->toBeKebabCase();
expect('abc_def')->toBeSnakeCase();
expect('AbcDef')->toBeStudlyCase();
expect('9001 ')->toBeDigits(); // failed because of the space.
expect('9001')->toBeDigits(); // true
You can now make sure that certain native functions aren't used in your application:
expect(['die', 'eval', 'sleep'])
->not
->toBeUsed();
This means you can easily check for things like "toBeCamelCase", "toBeSnakeCase", and more:
expect('abcDef')->toBeCamelCase();
expect('abc-def')->toBeKebabCase();
expect('abc_def')->toBeSnakeCase();
expect('AbcDef')->toBeStudlyCase();
Need to verify if a given string contains only digits?
expect('9001 ')->toBeDigits(); // fails because of the space.
expect('9001')->toBeDigits); // success
Nuno Maduro announced on X that Pest v2.16 is now out. This update comes packed with native functions support on the arch plugin, fresh expectations, and more. Here is a quick example of the new features:
expect(['die', 'eval', 'sleep'])->not->toBeUsed();
expect('abcDef')->toBeCamelCase();
expect('abc-def')->toBeKebabCase();
expect('abc_def')->toBeSnakeCase();
expect('AbcDef')->toBeStudlyCase();
expect('9001 ')->toBeDigits(); // failed because of the space.
expect('9001')->toBeDigits(); // true
You can now make sure that certain native functions aren't used in your application:
expect(['die', 'eval', 'sleep'])
->not
->toBeUsed();
This means you can easily check for things like "toBeCamelCase", "toBeSnakeCase", and more:
expect('abcDef')->toBeCamelCase();
expect('abc-def')->toBeKebabCase();
expect('abc_def')->toBeSnakeCase();
expect('AbcDef')->toBeStudlyCase();
Need to verify if a given string contains only digits?
expect('9001 ')->toBeDigits(); // fails because of the space.
expect('9001')->toBeDigits); // success
This is a test reply for the comment.
echo 'Hello World';