add expectations for uppercase, lowercase, alpha and alphanumeric

This commit is contained in:
JonPurvis
2023-08-12 16:41:15 +01:00
parent f1414a0beb
commit 54e00dd4dc
5 changed files with 128 additions and 0 deletions

View File

@ -0,0 +1,20 @@
<?php
use PHPUnit\Framework\ExpectationFailedException;
test('pass', function () {
expect('lowercase')->toBeLowercase();
expect('UPPERCASE')->not->toBeLowercase();
});
test('failures', function () {
expect('UPPERCASE')->toBeLowercase();
})->throws(ExpectationFailedException::class);
test('failures with custom message', function () {
expect('UPPERCASE')->toBeLowercase('oh no!');
})->throws(ExpectationFailedException::class, 'oh no!');
test('not failures', function () {
expect('lowercase')->not->toBeLowercase();
})->throws(ExpectationFailedException::class);