示例#1
0
 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());
 }
示例#2
0
 /**
  * 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);
     }
 }