Пример #1
0
 public function testGetPaths()
 {
     $provider1 = $this->getMock('Oro\\Component\\Layout\\Extension\\Theme\\PathProvider\\PathProviderInterface');
     $provider2 = $this->getMock('Oro\\Component\\Layout\\Extension\\Theme\\PathProvider\\PathProviderInterface');
     $provider3 = $this->getMock('Oro\\Component\\Layout\\Extension\\Theme\\PathProvider\\PathProviderInterface');
     $this->provider->addProvider($provider1, 100);
     $this->provider->addProvider($provider2, 0);
     $this->provider->addProvider($provider3, -100);
     $provider1->expects($this->once())->method('getPaths')->will($this->returnCallback(function (array $existingPaths) {
         $existingPaths[] = 'testPath1';
         $existingPaths[] = 'testPath2/testSubPath';
         return $existingPaths;
     }));
     $provider2->expects($this->once())->method('getPaths')->will($this->returnCallback(function (array $existingPaths) {
         $existingPaths[] = 'testPath1';
         return $existingPaths;
     }));
     $provider3->expects($this->once())->method('getPaths')->will($this->returnCallback(function (array $existingPaths) {
         $existingPaths[] = 'testPath1/testSubPath';
         return $existingPaths;
     }));
     $this->assertSame(['path', 'testPath1', 'testPath2/testSubPath', 'testPath1/testSubPath'], array_values($this->provider->getPaths(['path'])));
 }
Пример #2
0
 /**
  * @param array $paths
  */
 protected function setUpResourcePathProvider($paths)
 {
     $this->provider->expects($this->any())->method('getPaths')->willReturn((array) $paths);
 }