/**
  * @dataProvider getAssetsDataProvider
  */
 public function testGetAssets($config, $expectedCss)
 {
     $extension = new OroAsseticExtension();
     $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerBuilder');
     $container->expects($this->once())->method('getParameter')->will($this->returnValue(['Oro\\Bundle\\AsseticBundle\\Tests\\Unit\\Fixtures\\TestBundle']));
     $assets = $extension->getAssets($container, $config);
     $this->assertEquals($expectedCss, $assets['css']);
 }
Пример #2
0
 /**
  * @dataProvider loadDataProvider
  */
 public function testLoad(array $configs, array $expectedBundles, array $expectedConfiguration)
 {
     CumulativeResourceManager::getInstance()->clear()->setBundles($expectedBundles);
     $extension = new OroAsseticExtension();
     $container = new ContainerBuilder();
     $container->setParameter('kernel.bundles', $expectedBundles);
     $extension->load($configs, $container);
     $this->assertEquals($expectedConfiguration, $container->getParameter('oro_assetic.raw_configuration'));
     $this->assertNotNull($container->getDefinition('oro_assetic.configuration'));
     $this->assertNotNull($container->getDefinition('oro_assetic.twig.extension'));
 }