예제 #1
0
 /**
  * @param string $name
  * @param array $bundles
  * @dataProvider getBundleDataProvider
  */
 public function testGetBundle($name, array $bundles)
 {
     // SingleInheritanceBundle extends NoInheritanceBundle
     // DoubleInheritanceBundle extends SingleInheritanceBundle
     $bundleMap = ['NoInheritanceBundle' => ['DoubleInheritanceBundle', 'SingleInheritanceBundle', 'NoInheritanceBundle'], 'SingleInheritanceBundle' => ['DoubleInheritanceBundle', 'SingleInheritanceBundle'], 'DoubleInheritanceBundle' => ['DoubleInheritanceBundle']];
     $this->kernel->setBundleMap($bundleMap);
     $actualBundles = $this->kernel->getBundle($name, false);
     $this->assertEquals($bundles, $actualBundles);
     $this->assertEquals(current($actualBundles), $this->kernel->getBundle($name, true));
 }
예제 #2
0
 public function registerBundles()
 {
     $bundles = array();
     if (in_array($this->getEnvironment(), array('dev'))) {
         $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
         $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
         $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
     }
     if (in_array($this->getEnvironment(), array('test'))) {
         $bundles[] = new Oro\Bundle\TestFrameworkBundle\OroTestFrameworkBundle();
     }
     return array_merge(parent::registerBundles(), $bundles);
 }
 protected function initializeContainer()
 {
     static $first = true;
     if ('test' !== $this->getEnvironment()) {
         parent::initializeContainer();
         return;
     }
     $debug = $this->debug;
     if (!$first) {
         // disable debug mode on all but the first initialization
         $this->debug = false;
     }
     // will not work with --process-isolation
     $first = false;
     try {
         parent::initializeContainer();
     } catch (\Exception $e) {
         $this->debug = $debug;
         throw $e;
     }
     $this->debug = $debug;
 }
예제 #4
0
파일: AppKernel.php 프로젝트: sk0wp/pim12
 /**
  * {@inheritdoc}
  */
 public function registerBundles()
 {
     $bundles = array();
     if (in_array($this->getEnvironment(), array('dev', 'test', 'behat'))) {
         $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
         $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
         $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
     }
     $oroBundles = parent::registerBundles();
     $exclude = array('Oro\\Bundle\\ImportExportBundle\\OroImportExportBundle', 'Oro\\Bundle\\QueryDesignerBundle\\OroQueryDesignerBundle', 'JMS\\JobQueueBundle\\JMSJobQueueBundle', 'Oro\\Bundle\\AddressBundle\\OroAddressBundle', 'Oro\\Bundle\\SoapBundle\\OroSoapBundle', 'Oro\\Bundle\\SyncBundle\\OroSyncBundle', 'Oro\\Bundle\\WorkflowBundle\\OroWorkflowBundle', 'Oro\\Bundle\\NotificationBundle\\OroNotificationBundle', 'Oro\\Bundle\\CalendarBundle\\OroCalendarBundle', 'Oro\\Bundle\\CronBundle\\OroCronBundle', 'Oro\\Bundle\\SearchBundle\\OroSearchBundle', 'Oro\\Bundle\\TagBundle\\OroTagBundle');
     foreach ($oroBundles as $bundleIndex => $bundle) {
         if (in_array(get_class($bundle), $exclude)) {
             unset($oroBundles[$bundleIndex]);
         }
     }
     $bundles = array_merge($oroBundles, $bundles);
     $pimDepBundles = array(new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(), new APY\JsFormValidationBundle\APYJsFormValidationBundle(), new Akeneo\Bundle\MeasureBundle\AkeneoMeasureBundle(), new Akeneo\Bundle\BatchBundle\AkeneoBatchBundle());
     $bundles = array_merge($bundles, $pimDepBundles);
     $pimBundles = array(new Pim\Bundle\NavigationBundle\PimNavigationBundle(), new Pim\Bundle\FilterBundle\PimFilterBundle(), new Pim\Bundle\UserBundle\PimUserBundle(), new Pim\Bundle\JsFormValidationBundle\PimJsFormValidationBundle(), new Pim\Bundle\EntityBundle\PimEntityBundle(), new Pim\Bundle\DashboardBundle\PimDashboardBundle(), new Pim\Bundle\InstallerBundle\PimInstallerBundle(), new Pim\Bundle\UIBundle\PimUIBundle(), new Pim\Bundle\CatalogBundle\PimCatalogBundle(), new Pim\Bundle\DataGridBundle\PimDataGridBundle(), new Pim\Bundle\TranslationBundle\PimTranslationBundle(), new Pim\Bundle\ImportExportBundle\PimImportExportBundle(), new Pim\Bundle\VersioningBundle\PimVersioningBundle(), new Pim\Bundle\WebServiceBundle\PimWebServiceBundle(), new Pim\Bundle\EnrichBundle\PimEnrichBundle(), new Pim\Bundle\BaseConnectorBundle\PimBaseConnectorBundle(), new Pim\Bundle\TransformBundle\PimTransformBundle(), new Naolis\Bundle\RouchyConnectorBundle\NaolisRouchyConnectorBundle(), new Naolis\Bundle\SpecificConnectorBundle\NaolisSpecificConnectorBundle());
     $bundles = array_merge($bundles, $pimBundles);
     return $bundles;
 }
예제 #5
0
 /**
  * @param array $bundles
  *
  * @dataProvider bundlesDataProvider
  */
 public function testCollectBundles(array $bundles)
 {
     $this->assertEquals($bundles, $this->kernel->registerBundles());
 }