diff options
| author | 2024-04-18 14:00:17 +0200 | |
|---|---|---|
| committer | 2024-04-18 14:00:17 +0200 | |
| commit | 3261b7bafbb8e7cd0003c0cfbf26e4d4a4b65def (patch) | |
| tree | a9b4dcb39a969df011923151263e29f215db4c40 /tests/app/Utils/dotpathUtilTest.php | |
| parent | 0ffcf41f9371b9321856d2c709cf7bcb4f7c3c60 (diff) | |
i18n improved: dotted path -> dot-notation (#6317)
* dotted path -> dot-notation
* dot-notation -> dot notation
* rename json_dotpath => json_dotnotation
* Update app/i18n/fr/sub.php
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Update app/i18n/fr/sub.php
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Update app/i18n/fr/sub.php
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Update app/i18n/nl/sub.php
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Update app/i18n/nl/sub.php
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Update app/i18n/nl/sub.php
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Update app/i18n/nl/sub.php
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Rename corresponding class
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Diffstat (limited to 'tests/app/Utils/dotpathUtilTest.php')
| -rw-r--r-- | tests/app/Utils/dotpathUtilTest.php | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/tests/app/Utils/dotpathUtilTest.php b/tests/app/Utils/dotpathUtilTest.php deleted file mode 100644 index eb1a1d486..000000000 --- a/tests/app/Utils/dotpathUtilTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -declare(strict_types=1); - -class dotpathUtilTest extends PHPUnit\Framework\TestCase { - - /** - * @return Traversable<array{array<string,mixed>,string,string}> - */ - public function provideJsonDots(): Traversable { - $json = <<<json - { - "hello": "world", - "deeper": { - "hello": "again" - }, - "items": [ - { - "meta": {"title": "first"} - }, - { - "meta": {"title": "second"} - } - ] - } - json; - $array = json_decode($json, true); - - yield [$array, 'hello', 'world']; - yield [$array, 'deeper.hello', 'again']; - yield [$array, 'items.0.meta.title', 'first']; - yield [$array, 'items[0].meta.title', 'first']; - yield [$array, 'items.1.meta.title', 'second']; - yield [$array, 'items[1].meta.title', 'second']; - } - - /** - * @dataProvider provideJsonDots - * @param array<string,mixed> $array - */ - public function testJsonDots(array $array, string $key, string $expected): void { - $value = FreshRSS_dotpath_Util::get($array, $key); - self::assertEquals($expected, $value); - } -} |
