Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed May 17, 2022
1 parent d521317 commit c0b357e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
3 changes: 2 additions & 1 deletion src/Arrays/ArrayUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public function removePrefix(string $prefix, array $array): array
* @param int $offset offset for inserting the new value
* @param bool $strict use strict behavior for array search
*
* @deprecated Use Utils::array()::insertAfterKey() instead
* @deprecated Use utils service instead
* @codeCoverageIgnore
*/
public function insertInArrayByName(array &$current, string $key, $value, int $offset = 0, bool $strict = false)
{
Expand Down
25 changes: 0 additions & 25 deletions tests/Arrays/ArrayUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,6 @@ public function testRemovePrefix()
$this->assertSame(['prefix_1' => 1], $result);
}

public function testInsertInArrayByName()
{
$arrayUtil = new ArrayUtil($this->getContainerMock());

$target = ['hello' => 'world'];
$arrayUtil->insertInArrayByName($target, 'foo', 'bar');
$this->assertSame(['hello' => 'world'], $target);

$target = ['hello' => 'world'];
$arrayUtil->insertInArrayByName($target, 'hello', 'foobar');
$this->assertSame(['foobar', 'hello' => 'world'], $target);

$target = ['hello' => 'world'];
$arrayUtil->insertInArrayByName($target, 'hello', 'foobar', 1);
$this->assertSame(['hello' => 'world', 'foobar'], $target);

$target = [0 => 'world'];
$arrayUtil->insertInArrayByName($target, '0', 'foobar', 1);
$this->assertSame(['world', 'foobar'], $target);

$target = [0 => 'world'];
$arrayUtil->insertInArrayByName($target, '0', 'foobar', 1, true);
$this->assertSame(['world'], $target);
}

public function testArrayToObject()
{
$arrayUtil = new ArrayUtil($this->getContainerMock());
Expand Down

0 comments on commit c0b357e

Please sign in to comment.