1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- /*
- * This file is part of the Sonata Project package.
- *
- * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace Sonata\AdminBundle\Tests\DependencyInjection;
- use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
- use Sonata\AdminBundle\DependencyInjection\SonataAdminExtension;
- class SonataAdminExtensionTest extends AbstractExtensionTestCase
- {
- public function testHasServiceDefinitionForLockExtension()
- {
- $this->container->setParameter('kernel.bundles', array());
- $this->load(array('options' => array('lock_protection' => true)));
- $this->assertContainerBuilderHasService('sonata.admin.lock.extension');
- }
- public function testNotHasServiceDefinitionForLockExtension()
- {
- $this->container->setParameter('kernel.bundles', array());
- $this->load(array('options' => array('lock_protection' => false)));
- $this->assertContainerBuilderNotHasService('sonata.admin.lock.extension');
- }
- public function testLoadsExporterServiceDefinitionWhenExporterBundleIsRegistered()
- {
- $this->container->setParameter('kernel.bundles', array('SonataExporterBundle' => 'whatever'));
- $this->load();
- $this->assertContainerBuilderHasService(
- 'sonata.admin.admin_exporter',
- 'Sonata\AdminBundle\Bridge\Exporter\AdminExporter'
- );
- }
- protected function getContainerExtensions()
- {
- return array(new SonataAdminExtension());
- }
- }
|