forked from TruCopilot/phpfastcache
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNewCacheInstance.test.php
More file actions
28 lines (22 loc) · 982 Bytes
/
Copy pathNewCacheInstance.test.php
File metadata and controls
28 lines (22 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
* @author Khoa Bui (khoaofgod) <khoaofgod@gmail.com> http://www.phpfastcache.com
* @author Georges.L (Geolim4) <contact@geolim4.com>
*/
use phpFastCache\Core\Pool\ExtendedCacheItemPoolInterface;
use phpFastCache\CacheManager;
use phpFastCache\Helper\TestHelper;
chdir(__DIR__);
require_once __DIR__ . '/../vendor/autoload.php';
$testHelper = new TestHelper('New cache instance');
$defaultDriver = (!empty($argv[1]) ? ucfirst($argv[1]) : 'Files');
/**
* Testing memcached as it is declared in .travis.yml
*/
$driverInstance = CacheManager::getInstance($defaultDriver);
if (!is_object($driverInstance) || !($driverInstance instanceof ExtendedCacheItemPoolInterface)) {
$testHelper->printFailText('CacheManager::getInstance() returned wrong data hint:' . gettype($driverInstance));
}else{
$testHelper->printPassText('CacheManager::getInstance() returned an expected object that implements ExtendedCacheItemPoolInterface');
}
$testHelper->terminateTest();