Skip to content

Commit

Permalink
Merge branch 'use-laravel-validations' of github.com-sowrensen:sowren…
Browse files Browse the repository at this point in the history
…sen/svg-avatar-generator into use-laravel-validations
  • Loading branch information
nemoitis committed Mar 5, 2024
2 parents de0b349 + 50951b3 commit 935168d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
it('will throw exception if font size less than minimum is provided', function () {
config(['svg-avatar.font_size' => 9]);
new SvgAvatarGenerator('Sansa Stark');
})->throws(ValidationException::class)->expectExceptionMessageMatches( '/The font size(?: field)? must be between 10 and 50/');
})->throws(ValidationException::class)->expectExceptionMessageMatches('/The font size(?: field)? must be between 10 and 50/');

it('will throw exception if font size greater than maximum is provided', function () {
config(['svg-avatar.font_size' => 51]);
new SvgAvatarGenerator('Arya Stark');
})->throws(ValidationException::class)->expectExceptionMessageMatches( '/The font size(?: field)? must be between 10 and 50/');
})->throws(ValidationException::class)->expectExceptionMessageMatches('/The font size(?: field)? must be between 10 and 50/');

it('will throw exception if gradient rotation less than minimum is provided', function () {
config(['svg-avatar.gradient_rotation' => -1]);
new SvgAvatarGenerator('Brandon Stark');
})->throws(ValidationException::class)->expectExceptionMessageMatches( '/The gradiant rotation(?: field)? must be between 0 and 360/');
})->throws(ValidationException::class)->expectExceptionMessageMatches('/The gradiant rotation(?: field)? must be between 0 and 360/');

it('will throw exception if gradient rotation greater than maximum is provided', function () {
config(['svg-avatar.gradient_rotation' => 361]);
new SvgAvatarGenerator('Rickon Stark');
})->throws(ValidationException::class)->expectExceptionMessageMatches( '/The gradiant rotation(?: field)? must be between 0 and 360/');
})->throws(ValidationException::class)->expectExceptionMessageMatches('/The gradiant rotation(?: field)? must be between 0 and 360/');

it('will throw missing text exception if text is not set', function () {
$generator = new SvgAvatarGenerator();
Expand Down

0 comments on commit 935168d

Please sign in to comment.