summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAsko Nomm <asko@bien.ee>2022-02-23 18:01:02 +0100
committerAsko Nomm <asko@bien.ee>2022-02-23 18:01:02 +0100
commiteedb71682cc1f62bc9789945c952194e2f5efa03 (patch)
tree573a2265f2f3aaa38eaf30fa3a5d56eea8a3b57d /tests
parent6b5b238e838116560e298deff4c9bcab140ac050 (diff)
Rename Bouncer to Hird
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.',
]);