Skip to content

Commit 80f41cf

Browse files
committed
Assert that the Service Account class can be mapped with Valinor
1 parent b7dc358 commit 80f41cf

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ If it saves you or your team time, please consider [sponsoring its development](
1010
* Realtime Database references are now validated by the API instead of locally. Validation rules can change at any time,
1111
and the SDK can only adapt to changes in the API. While local checks could prevent obviously invalid paths, they’d
1212
also require an SDK update whenever Firebase loosens a rule. Developers can be trusted not to use invalid paths 😅.
13+
* Removed the `#[SensitiveParameter]` attribute again, because it's supported by PHP 8.1 itself, but not in combination
14+
with Valinor.
15+
([#1034](https://github.com/kreait/firebase-php/pull/1034))
1316

1417
## [7.23.0] - 2025-10-13
1518

tests/Unit/ServiceAccountTest.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Kreait\Firebase\Tests\Unit;
6+
7+
use Kreait\Firebase\ServiceAccount;
8+
use Kreait\Firebase\Valinor\Mapper;
9+
use PHPUnit\Framework\TestCase;
10+
11+
final class ServiceAccountTest extends TestCase
12+
{
13+
/**
14+
* @see https://github.com/kreait/firebase-php/pull/1034
15+
*/
16+
public function testItCanBeMapped(): void
17+
{
18+
$mapper = (new Mapper())->allowSuperfluousKeys()->snakeToCamelCase();
19+
20+
$input = [
21+
'type' => 'service_account',
22+
'project_id' => 'project-id',
23+
'client_email' => 'client-email',
24+
'private_key' => 'private-key',
25+
];
26+
27+
$serviceAccount = $mapper->map(ServiceAccount::class, $input);
28+
29+
$this->assertInstanceOf(ServiceAccount::class, $serviceAccount);
30+
}
31+
}

0 commit comments

Comments
 (0)