Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12945452
CacheFactoryTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
831 B
Referenced Files
None
Subscribers
None
CacheFactoryTest.php
View Options
<?php
namespace
Keruald\Cache\Tests
;
use
Keruald\Cache\CacheFactory
;
use
Keruald\Cache\Engines\CacheVoid
;
use
PHPUnit\Framework\TestCase
;
use
Psr\SimpleCache\CacheException
;
class
CacheFactoryTest
extends
TestCase
{
public
function
testLoad
()
{
$config
=
[
"engine"
=>
CacheDummy
::
class
,
];
$cache
=
CacheFactory
::
load
(
$config
);
$this
->
assertInstanceOf
(
CacheDummy
::
class
,
$cache
);
}
public
function
testLoadDefaultsToVoid
()
{
$cache
=
CacheFactory
::
load
([]);
$this
->
assertInstanceOf
(
CacheVoid
::
class
,
$cache
);
}
public
function
testLoadWithNonExistentClass
()
{
$config
=
[
"engine"
=>
"Acme
\\
Nonexistent"
,
];
$this
->
expectException
(
CacheException
::
class
);
CacheFactory
::
load
(
$config
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Nov 18, 17:36 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3148098
Default Alt Text
CacheFactoryTest.php (831 B)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment