예제 #1
0
파일: Cache.php 프로젝트: jgswift/qio
 /**
  * Construct base implementation of cache
  * @param callable|boolean $hash
  * @param string $prefix
  * @param array $rules
  * @param array $assets
  */
 public function __construct($hash = false, $prefix = '', array $rules = [], array $assets = [])
 {
     $this->hash = $hash;
     $this->prefix = $prefix;
     $this->rules = new qtil\Collection();
     $this->assets = new qtil\Collection();
     $this->assets->merge($assets);
     $this->rules->merge($rules);
 }
예제 #2
0
 function testCollectionFromCollection()
 {
     $data = range(0, 3);
     $collection = new qtil\Collection();
     $collection->merge($data);
     $collection2 = new qtil\Collection();
     $collection2->fromCollection($collection);
     $this->assertEquals($collection->toArray(), $collection2->toArray());
 }