Skip to content

Commit 455d160

Browse files
authored
[9.x] Improve test for prepend and push in Repository Class (#43833)
we have to check item are exist and didn't destory in array
1 parent 042406a commit 455d160

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/Config/RepositoryTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,21 @@ public function testSetArray()
173173

174174
public function testPrepend()
175175
{
176+
$this->assertSame('aaa', $this->repository->get('array.0'));
177+
$this->assertSame('zzz', $this->repository->get('array.1'));
176178
$this->repository->prepend('array', 'xxx');
177179
$this->assertSame('xxx', $this->repository->get('array.0'));
180+
$this->assertSame('aaa', $this->repository->get('array.1'));
181+
$this->assertSame('zzz', $this->repository->get('array.2'));
178182
}
179183

180184
public function testPush()
181185
{
186+
$this->assertSame('aaa', $this->repository->get('array.0'));
187+
$this->assertSame('zzz', $this->repository->get('array.1'));
182188
$this->repository->push('array', 'xxx');
189+
$this->assertSame('aaa', $this->repository->get('array.0'));
190+
$this->assertSame('zzz', $this->repository->get('array.1'));
183191
$this->assertSame('xxx', $this->repository->get('array.2'));
184192
}
185193

0 commit comments

Comments
 (0)