Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- A guard now keeps literal credentials out of the tests, and every credential generated with
`TestCredentials` named with a single word, so secret scanning has nothing to report.
`laranail/package-tools` is raised to `^0.1.10`, which ships the purpose check.

- The `repositories` block replaces Packagist with a copy that excludes `laranail/*`, so
`laranail/package-tools` can only resolve from its VCS repository and never from a stale
Packagist copy of the same name. This is the family's standard block.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"laravel/pint": "^1.30",
"orchestra/testbench": "^11.1",
"pestphp/pest": "^5.1",
"laranail/package-tools": "^0.1"
"laranail/package-tools": "^0.1.10"
},
"autoload": {
"psr-4": {
Expand Down
21 changes: 21 additions & 0 deletions tests/Architecture/NoLiteralCredentialsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

use Simtabi\Laranail\Package\Tools\Testing\AssertsNoLiteralCredentials;

/*
* Secret scanning cannot tell a test password from a leaked one, and reports both. Tests take
* their credentials from TestCredentials at run time; this fails on any literal left behind.
*/
uses(AssertsNoLiteralCredentials::class);

it('keeps literal credentials out of the tests', function (): void {
$this->assertNoLiteralCredentialsIn([dirname(__DIR__)], minFiles: 4);
expect(true)->toBeTrue();
});

it('names every generated credential with a single word', function (): void {
$this->assertCredentialPurposesAreWordsIn([dirname(__DIR__)], minFiles: 4);
expect(true)->toBeTrue();
});
Loading