/** * 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); }
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()); }