Author: Thomas Müller (t_mueller_stolzenhain@yahoo.de)
Inheritance: implements BrowscapPHP\Cache\BrowscapCacheInterface
コード例 #1
0
 public function testType()
 {
     $adapter = new Memory();
     $cache = new BrowscapCache($adapter);
     $this->assertNull($cache->getType());
     $cache->setItem('browscap.type', 'LITE', false);
     $this->assertEquals('LITE', $cache->getType());
 }
コード例 #2
0
 /**
  * This method is called before the first test of this test class is run.
  *
  * @since Method available since Release 3.4.0
  */
 public static function setUpBeforeClass()
 {
     $objectIniPath = ini_get('browscap');
     if (!is_file($objectIniPath)) {
         self::markTestSkipped('browscap not defined in php.ini');
     }
     // Now, load an INI file into BrowscapPHP\Browscap for testing the UAs
     self::$object = new Browscap();
     $cacheAdapter = new Memory();
     $cache = new BrowscapCache($cacheAdapter);
     $cache->flush();
     self::$object->setCache($cache)->convertFile($objectIniPath);
 }