コード例 #1
0
ファイル: MySQLTest.php プロジェクト: alambike/phpback
 public function setUp()
 {
     parent::setup();
     if (!extension_loaded('mysqlnd')) {
         $this->markTestSkipped('The MySQLnd extension is not available.');
     }
     $this->cache = new Cache(new MySQL($this->config['mysql']['host'], $this->config['mysql']['user'], $this->config['mysql']['password'], $this->config['mysql']['database'], $this->config['mysql']['port']));
 }
コード例 #2
0
ファイル: MongoTest.php プロジェクト: alambike/phpback
 public function setUp()
 {
     parent::setup();
     if (!class_exists('Mongo')) {
         $this->markTestSkipped('The Mongo extension is not available.');
     }
     $this->cache = new Cache(new Mongo($this->config['mongo']['dns']));
 }
コード例 #3
0
ファイル: ApcCacheTest.php プロジェクト: alambike/phpback
 public function setUp()
 {
     parent::setup();
     if (!extension_loaded('apc') || !ini_get('apc.enable_cli')) {
         $this->markTestSkipped('The APC extension is not available.');
     }
     $this->cache = new Cache(new Apc());
 }
コード例 #4
0
ファイル: MemCacheTest.php プロジェクト: alambike/phpback
 public function setUp()
 {
     parent::setup();
     if (!extension_loaded('memcached') || !class_exists('\\Memcache')) {
         $this->markTestSkipped('The Memcache extension is not available.');
     }
     $adapter = new MemCache();
     $adapter->addServer('localhost', 11211);
     $this->cache = new Cache($adapter);
 }
コード例 #5
0
ファイル: MemcachedTest.php プロジェクト: BrightLocal/Cache
 public function setUp()
 {
     parent::setup();
     if (!extension_loaded('memcached') || !class_exists('\\Memcached')) {
         $this->markTestSkipped('The Memcached extension is not available.');
     }
     $data = [['host' => 'localhost', 'port' => 11211, 'weight' => 0]];
     $adapter = new Memcached($data);
     $this->cache = new Cache($adapter);
 }
コード例 #6
0
ファイル: FileTest.php プロジェクト: alambike/phpback
 public function setUp()
 {
     parent::setup();
     $this->cache = new Cache(new File($this->config['file']['dir']));
 }
コード例 #7
0
ファイル: RedisTest.php プロジェクト: alambike/phpback
 public function setUp()
 {
     parent::setup();
     $this->cache = new Cache(new Redis());
 }