diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/HirdTest.php (renamed from tests/BouncerTest.php) | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/BouncerTest.php b/tests/HirdTest.php index 473b476..273eff6 100644 --- a/tests/BouncerTest.php +++ b/tests/HirdTest.php @@ -1,21 +1,21 @@ <?php -use Askonomm\Bouncer\Bouncer; +use Askonomm\Hird\Hird; test('Validate a correct e-mail address', function () { $fields = ['email' => 'asko@bien.ee']; $rules = ['email' => 'email']; - $bouncer = new Bouncer($fields, $rules); + $hird = new Hird($fields, $rules); - expect($bouncer->fails())->toBeFalse(); + expect($hird->fails())->toBeFalse(); }); test('Validate an incorrect e-mail address', function () { $fields = ['email' => 'this-is-not-right']; $rules = ['email' => 'email']; - $bouncer = new Bouncer($fields, $rules); + $hird = new Hird($fields, $rules); - expect($bouncer->errors())->toBe([ + expect($hird->errors())->toBe([ 'email is not a valid e-mail address.' ]); }); @@ -23,17 +23,17 @@ test('Validate an incorrect e-mail address', function () { test('Validate a correct length of string', function () { $fields = ['string' => 'i-am-fine-as-i-am-long']; $rules = ['string' => 'len:8']; - $bouncer = new Bouncer($fields, $rules); + $hird = new Hird($fields, $rules); - expect($bouncer->fails())->toBeFalse(); + expect($hird->fails())->toBeFalse(); }); test('Validate an incorrect length of string', function () { $fields = ['string' => 'i-am-short']; $rules = ['string' => 'len:15']; - $bouncer = new Bouncer($fields, $rules); + $hird = new Hird($fields, $rules); - expect($bouncer->errors())->toBe([ + expect($hird->errors())->toBe([ 'string is shorter than the required 15 characters.' ]); }); @@ -41,9 +41,9 @@ test('Validate an incorrect length of string', function () { test('Validate a correct required string', function () { $fields = ['string' => 'i-am-required']; $rules = ['string' => 'required']; - $bouncer = new Bouncer($fields, $rules); + $hird = new Hird($fields, $rules); - expect($bouncer->fails())->toBeFalse(); + expect($hird->fails())->toBeFalse(); }); test('Validate an incorrect required string', function () { @@ -59,9 +59,9 @@ test('Validate an incorrect required string', function () { 'false-value' => 'required', ]; - $bouncer = new Bouncer($fields, $rules); + $hird = new Hird($fields, $rules); - expect($bouncer->errors())->toBe([ + expect($hird->errors())->toBe([ 'empty-string is required.', 'null-value is required.', ]); |
