Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
EinfachLeo committed Jun 26, 2024
2 parents 49d4392 + 45a24e7 commit 3cc5991
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Changelog

All notable changes to `laravel-audit` will be documented in this file.

## Initial Release - 2024-06-26

**Full Changelog**: https://github.com/Hexafuchs/laravel-audit/commits/v0.0.1
4 changes: 2 additions & 2 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
$instance = app()->make($check);
$names[] = $instance->getName();
}
expect(sizeof($names))->toBe(sizeof(array_unique($names)));
expect(count($names))->toBe(count(array_unique($names)));
});

it('contains different errors', function () {
Expand All @@ -46,5 +46,5 @@
$errors[] = $instance->getError()->message;
}

expect(sizeof($errors))->toBe(sizeof(array_unique($errors)));
expect(count($errors))->toBe(count(array_unique($errors)));
});
7 changes: 2 additions & 5 deletions tests/ResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
it('returns check results', function () {
$result = Audit::run();

expect($result->doesntContain(fn ($e) => !($e instanceof \Hexafuchs\Audit\Checks\CheckResult)))->toBeTrue();
expect($result->doesntContain(fn ($e) => ! ($e instanceof \Hexafuchs\Audit\Checks\CheckResult)))->toBeTrue();
});

it('contains enough results', function () {
$result = Audit::run();

expect($result->count() === sizeof(config('audit.checks')))->toBeTrue();
expect($result->count() === count(config('audit.checks')))->toBeTrue();
});

it('contains no null group names', function () {
Expand All @@ -20,12 +20,9 @@
expect($result->map(fn ($e) => $e->group)->doesntContain(fn ($e) => $e === null))->toBeTrue();
});


it('contains unique names', function () {
$result = Audit::run();
$names = $result->map(fn ($e) => $e->name);

expect($names->count() === $names->unique()->count())->toBeTrue();
});


0 comments on commit 3cc5991

Please sign in to comment.