Skip to content

Commit

Permalink
fix: add test for SensitiveParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
heap-s committed Sep 3, 2024
1 parent 42ac659 commit c8ef853
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Db/Driver/PDO/PDODriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,17 @@ public function testGetUsername(): void

$this->assertSame('username', $pdoDriver->getUsername());
}

public function testSensitiveParameter(): void
{
try {
$fn = static function(#[\SensitiveParameter] string $password): void {
};
$fn(null);
} catch (\Throwable $e) {
$trace = $e->getTrace()[0];
$valid = isset($trace['args']) && $trace['args'][0] instanceof \SensitiveParameterValue;
var_dump($valid);
}
}
}

0 comments on commit c8ef853

Please sign in to comment.