Skip to content

Commit

Permalink
Merge pull request #47 from ElectricMaxxx/master
Browse files Browse the repository at this point in the history
add sonata_admin_orm and sonata_admin_phpcr bundle sets
  • Loading branch information
wouterj committed Apr 25, 2014
2 parents 3ee936d + 8a78675 commit 0376232
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
1.1.0-RC2
---------

* **2014-04-24**: add bundle sets: sonata_admin_orm and sonata_admin_phpcr
* **2014-04-11**: drop Symfony 2.2 compatibility

1.1.0-RC1
Expand Down
44 changes: 32 additions & 12 deletions src/Symfony/Cmf/Component/Testing/HttpKernel/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,48 @@ abstract class TestKernel extends Kernel
public function init()
{
$this->registerBundleSet('default', array(
'\Symfony\Bundle\FrameworkBundle\FrameworkBundle',
'\Symfony\Bundle\SecurityBundle\SecurityBundle',
'\Symfony\Bundle\TwigBundle\TwigBundle',
'\Symfony\Bundle\MonologBundle\MonologBundle',
'Symfony\Bundle\FrameworkBundle\FrameworkBundle',
'Symfony\Bundle\SecurityBundle\SecurityBundle',
'Symfony\Bundle\TwigBundle\TwigBundle',
'Symfony\Bundle\MonologBundle\MonologBundle',
));

$this->registerBundleSet('phpcr_odm', array(
'\Doctrine\Bundle\DoctrineBundle\DoctrineBundle',
'\Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle',
'Doctrine\Bundle\DoctrineBundle\DoctrineBundle',
'Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle',
));

$this->registerBundleSet('doctrine_orm', array(
'\Doctrine\Bundle\DoctrineBundle\DoctrineBundle',
'Doctrine\Bundle\DoctrineBundle\DoctrineBundle',
));

$this->registerBundleSet('sonata_admin', array(
'\Sonata\BlockBundle\SonataBlockBundle',
'\Sonata\CoreBundle\SonataCoreBundle',
'\Sonata\AdminBundle\SonataAdminBundle',
'\Sonata\jQueryBundle\SonatajQueryBundle',
'Sonata\BlockBundle\SonataBlockBundle',
'Sonata\CoreBundle\SonataCoreBundle',
'Sonata\AdminBundle\SonataAdminBundle',
'Sonata\jQueryBundle\SonatajQueryBundle',
'Knp\Bundle\MenuBundle\KnpMenuBundle',
'\Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle',
'Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle',
'Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle',
'FOS\JsRoutingBundle\FOSJsRoutingBundle',
));

$this->registerBundleSet('sonata_admin_orm', array(
'Sonata\BlockBundle\SonataBlockBundle',
'Sonata\CoreBundle\SonataCoreBundle',
'Sonata\AdminBundle\SonataAdminBundle',
'Sonata\jQueryBundle\SonatajQueryBundle',
'Knp\Bundle\MenuBundle\KnpMenuBundle',
'FOS\JsRoutingBundle\FOSJsRoutingBundle',
));

$this->registerBundleSet('sonata_admin_phpcr', array(
'Sonata\BlockBundle\SonataBlockBundle',
'Sonata\CoreBundle\SonataCoreBundle',
'Sonata\AdminBundle\SonataAdminBundle',
'Sonata\jQueryBundle\SonatajQueryBundle',
'Knp\Bundle\MenuBundle\KnpMenuBundle',
'Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle',
'Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle',
'FOS\JsRoutingBundle\FOSJsRoutingBundle',
));
Expand Down
19 changes: 14 additions & 5 deletions tests/HttpKernel/TestKernelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,23 @@ public function setUp()
);
}

public function testBundleSetRequire()
/**
* @dataProvider bundleSetProvider
*/
public function testBundleSetRequire(array $bundleSets, $count)
{
$this->kernel->init();
$this->kernel->requireBundleSets(array(
'default', 'phpcr_odm'
));
$this->kernel->requireBundleSets($bundleSets);
$bundles = $this->kernel->registerBundles();
$this->assertCount(6, $bundles);
$this->assertCount($count, $bundles);
}

public function bundleSetProvider()
{
return array(
array(array('default', 'phpcr_odm'), 6),
array(array('default', 'doctrine_orm'), 5),
);
}

public function testBundleAdd()
Expand Down

0 comments on commit 0376232

Please sign in to comment.