/**
  * @dataProvider getAddSubIconTestValues
  * @param array $parameters
  * @param ProviderInterface|NULL
  * @param string|NULL $expected
  */
 public function testAddSubIcon(array $parameters, $provider, $expected)
 {
     $GLOBALS['TCA']['tt_content']['columns']['field']['config']['type'] = 'flex';
     $cache = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array('has', 'set'));
     $cache->expects($this->once())->method('has')->willReturn(FALSE);
     $cache->expects($this->once())->method('set')->willReturn('icon');
     $service = $this->getMock('FluidTYPO3\\Flux\\Service\\FluxService', array('resolvePrimaryConfigurationProvider'));
     $service->expects($this->any())->method('resolvePrimaryConfigurationProvider')->willReturn($provider);
     $instance = new ContentIconHookSubscriber();
     $instance->injectFluxService($service);
     ObjectAccess::setProperty($instance, 'cache', $cache, TRUE);
     $result = $instance->addSubIcon($parameters, new PageLayoutView());
     if (NULL === $expected) {
         $this->assertNull($result);
     } else {
         $this->assertNotNull($result);
     }
     unset($GLOBALS['TCA']);
 }