language list fix

This commit is contained in:
Yuri Kuznetsov
2025-07-21 16:06:41 +03:00
parent 44333b81a1
commit c1a23a9d49
3 changed files with 117 additions and 12 deletions
@@ -128,6 +128,36 @@ class DataUtilTest extends \PHPUnit\Framework\TestCase
$this->assertEquals($expectedResultData, $data1);
}
public function testUnsetRemoveEmpty(): void
{
$data = (object) [
'scopeNames' => [
'a' => 'test',
'b' => 'test',
],
'scopeNamesPlural' => [
'a' => 'test',
'b' => 'test',
],
];
DataUtil::unsetByKey($data, [['lists', 'k']], true);
$this->assertEquals(
(object) [
'scopeNames' => [
'a' => 'test',
'b' => 'test',
],
'scopeNamesPlural' => [
'a' => 'test',
'b' => 'test',
],
],
$data
);
}
public function testUnsetByValue()
{
$data = json_decode('{