Skip to content

Commit 96ba7d5

Browse files
committed
Add test to ensure non-latin values can be JSON-encoded
See #1031
1 parent 7e2c321 commit 96ba7d5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Integration/Database/ReferenceTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,21 @@ public function setServerTimestamp(): void
151151
$this->assertIsInt($value['updatedAt']);
152152
}
153153

154+
/**
155+
* @see https://github.com/kreait/firebase-php/issues/1031
156+
*/
157+
#[Test]
158+
public function useNonLatinCharacters(): void
159+
{
160+
$ref = $this->ref->getChild(__FUNCTION__);
161+
162+
$value = ['nested' => [['content' => 'لقد تعطل']]];
163+
164+
$ref->set($value);
165+
166+
$this->assertSame($value, $ref->getValue());
167+
}
168+
154169
public static function validValues(): Iterator
155170
{
156171
yield 'string' => ['string', 'value'];

0 commit comments

Comments
 (0)