public function testClear() { $this->object->addFile('a.txt'); $this->object->addRemoteFile('http://jquery.com/jquery.js'); $this->object->clear(); $this->assertEquals(array(), $this->object->getFiles()); $this->assertEquals(array(), $this->object->getRemoteFiles()); }
/** * Attaches BowerLoader to the FileCollection instance. * @param FileCollection * @param string resource type (eg. "css") * @return void */ public function attach(FileCollection $collection, $resource) { if ($this->prepend) { $files = $collection->getFiles(); $remoteFiles = $collection->getRemoteFiles(); $collection->clear(); } $collection->addFiles($this->getFiles($resource)); if ($this->prepend) { $collection->addFiles($files); $collection->addRemoteFiles($remoteFiles); } }