Skip to content

Commit

Permalink
test: add snapshot update command
Browse files Browse the repository at this point in the history
- Added `pest-update-snapshots` command to update snapshots
- Updated `ConcreteScoresTest` and `HasOptionsTest`
  • Loading branch information
guanguans committed Jan 16, 2024
1 parent 0f38df4 commit 9bd07a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
"pest": "@php ./vendor/bin/pest --coverage",
"pest-coverage": "@pest --coverage-html=./build/phpunit/ --coverage-clover=./clover.xml",
"pest-migrate-configuration": "@pest --migrate-configuration",
"pest-update-snapshots": "@pest -d --update-snapshots",
"phpstan": "@php ./vendor/bin/phpstan analyse --ansi -v",
"phpstan-baseline": "@phpstan --generate-baseline --allow-empty-baseline",
"post-merge": [
Expand All @@ -184,6 +185,7 @@
"test-migrate-configuration": "@pest-migrate-configuration",
"test-phpunit": "@php ./vendor/bin/phpunit --cache-result-file=./build/phpunit/.phpunit.result.cache --coverage-text --ansi -v",
"test-phpunit-coverage": "@test --coverage-html=./build/phpunit/ --coverage-clover=clover.xml",
"test-update-snapshots": "@pest-update-snapshots",
"yaml-lint": "@php ./vendor/bin/yaml-lint .github --ansi -v"
}
}
4 changes: 2 additions & 2 deletions tests/Concerns/ConcreteScoresTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
->arrayScores($sqls)
->toBeArray()
->toBeTruthy()
->each(function (Pest\Expectation $arrayScore): void {
$arrayScore->toBeArray()->toHaveKeys([
->each(function (Pest\Expectation $expectation): void {
$expectation->toBeArray()->toHaveKeys([
'ID',
'Fingerprint',
'Score',
Expand Down
4 changes: 2 additions & 2 deletions tests/Concerns/HasOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@
'stringable' => new class() {
public function __toString(): string
{
return __CLASS__;
return self::class;
}
},
'invoke' => new class() {
public function __invoke(): string
{
return __CLASS__;
return self::class;
}
},
]))
Expand Down

0 comments on commit 9bd07a3

Please sign in to comment.