Esempio n. 1
0
 /**
  * @test
  */
 public function filter()
 {
     $filter1 = $this->getMock('Tx_Asdis_System_Uri_Filter_ContainsProtocol');
     $filter2 = $this->getMock('Tx_Asdis_System_Uri_Filter_WildcardProtocol');
     $filter1->expects($this->once())->method('filter')->will($this->returnValue(array('/foo')));
     $filter2->expects($this->once())->method('filter');
     $this->chain->append($filter1);
     $this->chain->append($filter2);
     $this->chain->filter(array('/foo'));
 }
Esempio n. 2
0
 /**
  * @param array $paths Array of path strings.
  * @param array $masks Array of mask strings.
  * @return Tx_Asdis_Domain_Model_Asset_Collection
  */
 public function createAssetsFromPaths(array $paths, array $masks)
 {
     $filteredPaths = $this->filterChain->filter($paths);
     $paths = array_intersect($paths, $filteredPaths);
     $masks = array_intersect_key($masks, $paths);
     $assets = $this->createAssetCollection();
     foreach ($paths as $key => $path) {
         $assets->append($this->createAssetFromPath($path, $masks[$key]));
     }
     return $assets;
 }