Skip to content

Commit 9bd07a3

Browse files
committed
test: add snapshot update command
- Added `pest-update-snapshots` command to update snapshots - Updated `ConcreteScoresTest` and `HasOptionsTest`
1 parent 0f38df4 commit 9bd07a3

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
"pest": "@php ./vendor/bin/pest --coverage",
162162
"pest-coverage": "@pest --coverage-html=./build/phpunit/ --coverage-clover=./clover.xml",
163163
"pest-migrate-configuration": "@pest --migrate-configuration",
164+
"pest-update-snapshots": "@pest -d --update-snapshots",
164165
"phpstan": "@php ./vendor/bin/phpstan analyse --ansi -v",
165166
"phpstan-baseline": "@phpstan --generate-baseline --allow-empty-baseline",
166167
"post-merge": [
@@ -184,6 +185,7 @@
184185
"test-migrate-configuration": "@pest-migrate-configuration",
185186
"test-phpunit": "@php ./vendor/bin/phpunit --cache-result-file=./build/phpunit/.phpunit.result.cache --coverage-text --ansi -v",
186187
"test-phpunit-coverage": "@test --coverage-html=./build/phpunit/ --coverage-clover=clover.xml",
188+
"test-update-snapshots": "@pest-update-snapshots",
187189
"yaml-lint": "@php ./vendor/bin/yaml-lint .github --ansi -v"
188190
}
189191
}

tests/Concerns/ConcreteScoresTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
->arrayScores($sqls)
5959
->toBeArray()
6060
->toBeTruthy()
61-
->each(function (Pest\Expectation $arrayScore): void {
62-
$arrayScore->toBeArray()->toHaveKeys([
61+
->each(function (Pest\Expectation $expectation): void {
62+
$expectation->toBeArray()->toHaveKeys([
6363
'ID',
6464
'Fingerprint',
6565
'Score',

tests/Concerns/HasOptionsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@
135135
'stringable' => new class() {
136136
public function __toString(): string
137137
{
138-
return __CLASS__;
138+
return self::class;
139139
}
140140
},
141141
'invoke' => new class() {
142142
public function __invoke(): string
143143
{
144-
return __CLASS__;
144+
return self::class;
145145
}
146146
},
147147
]))

0 commit comments

Comments
 (0)