feat(expectations): add toStartWith

This commit is contained in:
Owen Voke
2020-09-16 08:20:00 +01:00
parent 1567923cda
commit cad8a41e6d
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<?php
use PHPUnit\Framework\ExpectationFailedException;
test('pass', function () {
expect('username')->toStartWith('user');
});
test('failures', function () {
expect('username')->toStartWith('password');
})->throws(ExpectationFailedException::class);
test('not failures', function () {
expect('username')->not->toStartWith('user');
})->throws(ExpectationFailedException::class);