Skip to content

Commit 9c238ff

Browse files
committed
Coverage 100% for EditableBlock trait
1 parent 81cdc21 commit 9c238ff

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

src/Traits/EditableBlock.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,4 @@ public function appendItem(mixed $data, ?string $key = null): self
3535
return $this;
3636
}
3737

38-
/**
39-
* @param array<int|string, mixed>|Block $value
40-
*/
41-
private static function forceBlock(array|Block $value): Block
42-
{
43-
if (!$value instanceof Block) {
44-
return Block::make($value);
45-
}
46-
return $value;
47-
}
4838
}

tests/BlockAppendTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,14 @@ public function testAppendsItem(): void
6868
["a", "b", ["c", "d"]],
6969
array_values($data1->toArray()),
7070
);
71+
72+
$data1->appendItem($arrayData2, "newkey");
73+
$this->assertCount(4, $data1);
74+
75+
$this->assertSame(
76+
["a", "b", ["c", "d"], "newkey" => ["c", "d"]],
77+
$data1->toArray(),
78+
);
79+
7180
}
7281
}

0 commit comments

Comments
 (0)