<?php declare(strict_types=1);

namespace Siler\Test\Unit\Prelude;

use PHPUnit\Framework\TestCase;
use function Siler\Arr\set;

class ArrTest extends TestCase
{
    public function testSet()
    {
        $fixture = ['foo' => ['bar' => 'baz']];
        $expected = ['foo' => ['bar' => 'qux']];
        set($fixture, 'foo.bar', 'qux');
        $this->assertSame($expected, $fixture);
    }
}

<?php declare(strict_types=1);

namespace Siler\Test\Unit\Prelude;

use PHPUnit\Framework\TestCase;
use function Siler\Arr\set;

class ArrTest extends TestCase
{
    public function testSet()
    {
        $fixture = ['foo' => ['bar' => 'baz']];
        $expected = ['foo' => ['bar' => 'qux']];

        set($fixture, 'foo.bar', 'qux');

        $this->assertSame($expected, $fixture);
    }

    public function testSetDeeplyCreates()
    {
        $fixture = ['foo' => []];
        $expected = ['foo' => ['bar' => 'qux']];

        set($fixture, 'foo.bar', 'qux');

        $this->assertSame($expected, $fixture);
    }
}

Add test for inexistent key on Arr\set
Add test for inexistent key on Arr\set
