/**
     * @dataProvider getPatterns
     */
    public function testGetContent($pattern)
    {
        $resource = new DirectoryResource(__DIR__, $pattern);
        $content = $resource->getContent();

        $this->assertInternalType('string', $content);
    }
Example #2
0
 /**
  * Constructor.
  *
  * @param LoaderInterface $loader  The templating loader
  * @param string          $bundle  The current bundle name
  * @param string          $path    The directory path
  * @param string          $pattern A regex pattern for file basenames
  */
 public function __construct(LoaderInterface $loader, $bundle, $path, $pattern = null)
 {
     $this->loader = $loader;
     $this->bundle = $bundle;
     $this->path = rtrim($path, '/') . '/';
     parent::__construct($path, $pattern);
 }