Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12944333
CacheVoidTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
CacheVoidTest.php
View Options
<?php
namespace
Keruald\Cache\Tests\Engines
;
use
Keruald\Cache\Engines\CacheVoid
;
use
Keruald\OmniTools\Collections\HashMap
;
use
PHPUnit\Framework\TestCase
;
class
CacheVoidTest
extends
TestCase
{
private
CacheVoid
$cache
;
protected
function
setUp
()
:
void
{
$this
->
cache
=
new
CacheVoid
;
}
public
function
testSet
()
{
$result
=
$this
->
cache
->
set
(
"foo"
,
"bar"
);
$this
->
assertTrue
(
$result
);
}
public
function
testDelete
()
{
$result
=
$this
->
cache
->
delete
(
"foo"
);
$this
->
assertTrue
(
$result
);
}
public
function
testClear
()
{
$result
=
$this
->
cache
->
clear
();
$this
->
assertTrue
(
$result
);
}
public
function
testGetMultiple
()
{
$expected
=
[
"foo"
=>
null
,
"bar"
=>
null
,
];
$results
=
$this
->
cache
->
getMultiple
([
"foo"
,
"bar"
]);
$results
=
HashMap
::
from
(
$results
)->
toArray
();
$this
->
assertEquals
(
$expected
,
$results
);
}
public
function
testDeleteMultiple
()
{
$result
=
$this
->
cache
->
deleteMultiple
([
"foo"
,
"bar"
]);
$this
->
assertTrue
(
$result
);
}
public
function
testGet
()
{
$this
->
assertNull
(
$this
->
cache
->
get
(
"foo"
));
}
public
function
testSetMultiple
()
{
$result
=
$this
->
cache
->
setMultiple
([
"foo"
=>
"bar"
,
"bar"
=>
"baz"
,
]);
$this
->
assertTrue
(
$result
);
}
public
function
testHas
()
{
$result
=
$this
->
cache
->
has
(
"foo"
);
$this
->
assertFalse
(
$result
);
}
public
function
testLoad
()
{
$cache
=
CacheVoid
::
load
([]);
$this
->
assertInstanceOf
(
CacheVoid
::
class
,
$cache
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Nov 18, 17:13 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3161422
Default Alt Text
CacheVoidTest.php (1 KB)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment