Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
SonyPradana committed Oct 8, 2024
1 parent 0525c72 commit 565dc44
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/Cache/CacheManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,14 @@ public function testSetDefaultDriver(): void
$this->assertTrue($cache->set('key1', 'value1'));
$this->assertEquals('value1', $cache->get('key1'));
}

public function testDriver(): void
{
$cache = new CacheManager();
$cache->setDriver('array2', fn (): CacheInterface => new ArrayStorage());
$this->assertInstanceOf(CacheInterface::class, $cache->driver('array'));

$this->assertTrue($cache->set('key1', 'value1'));
$this->assertEquals('value1', $cache->get('key1'));
}
}

0 comments on commit 565dc44

Please sign in to comment.