/**
  * @param $name
  * @param $template
  * @param $values
  * @dataProvider snippetsProvider
  */
 public function testInvoke($name, $template, $values)
 {
     $this->helper->appendSnippet($name, $template, $values);
     $invoke = $this->helper->__invoke();
     $this->assertInstanceOf('\\HangerSnippet\\View\\Helper\\SnippetHelper', $invoke);
     $this->assertCount(1, $invoke->getSnippets());
 }
 /**
  * Configure Snippet Helper
  * @param SnippetHelper $snippetHelper
  * @param array         $config
  * @param array         $snippetsConfig
  * @return SnippetHelper
  */
 protected function configureSnippetHelper(SnippetHelper $snippetHelper, array $config, array $snippetsConfig)
 {
     $enableAll = isset($snippetsConfig['enable_all']) ? (bool) $snippetsConfig['enable_all'] : true;
     foreach ($snippetsConfig['snippets'] as $name => $snippetsConfig) {
         $values = [];
         // Retrive values from global config if a config key was provided
         if (isset($snippetsConfig['config_key']) && isset($config[$snippetsConfig['config_key']])) {
             $values = $config[$snippetsConfig['config_key']];
         }
         // Merge provided values, if any
         if (isset($snippetsConfig['values'])) {
             $values = array_merge_recursive($values, $snippetsConfig['values']);
         }
         $snippetHelper->appendSnippet($name, isset($snippetsConfig['template']) ? $snippetsConfig['template'] : 'hanger-snippet/' . $name, $values, isset($snippetsConfig['placement']) ? $snippetsConfig['placement'] : null, isset($snippetsConfig['enabled']) ? $snippetsConfig['enabled'] : $enableAll);
     }
     return $snippetHelper;
 }