10000 Add tests · wkania/symfony@91331e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 91331e1

Browse files
Add tests
1 parent a4bfce3 commit 91331e1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Symfony/Component/Cache/Tests/Adapter/ArrayAdapterTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,17 @@ public function testEnum()
102102

103103
$this->assertSame(TestEnum::Foo, $cache->getItem('foo')->get());
104104
}
105+
106+
public function testExpiryCleanupOnError()
107+
{
108+
$cache = new ArrayAdapter();
109+
110+
$item = $cache->getItem('foo');
111+
$this->assertTrue($cache->save($item->set('bar')));
112+
$this->assertTrue($cache->hasItem('foo'));
113+
114+
$item->set(static fn () => null);
115+
$this->assertFalse($cache->save($item));
116+
$this->assertFalse($cache->hasItem('foo'));
117+
}
105118
}

0 commit comments

Comments
 (0)
0