1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?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\Block;
- use Sonata\AdminBundle\Admin\Pool;
- use Sonata\AdminBundle\Block\AdminListBlockService;
- use Sonata\AdminBundle\Tests\Fixtures\Block\FakeBlockService;
- use Sonata\BlockBundle\Test\AbstractBlockServiceTestCase;
- /**
- * @author Sullivan Senechal <soullivaneuh@gmail.com>
- */
- class AdminListBlockServiceTest extends AbstractBlockServiceTestCase
- {
- /**
- * @var Pool
- */
- private $pool;
- protected function setUp()
- {
- parent::setUp();
- $this->pool = $this->getMockBuilder('Sonata\AdminBundle\Admin\Pool')->disableOriginalConstructor()->getMock();
- }
- public function testDefaultSettings()
- {
- $blockService = new AdminListBlockService('foo', $this->templating, $this->pool);
- $blockContext = $this->getBlockContext($blockService);
- $this->assertSettings(array(
- 'groups' => false,
- ), $blockContext);
- }
- public function testOverriddenDefaultSettings()
- {
- $blockService = new FakeBlockService('foo', $this->templating, $this->pool);
- $blockContext = $this->getBlockContext($blockService);
- $this->assertSettings(array(
- 'foo' => 'bar',
- 'groups' => true,
- ), $blockContext);
- }
- }
|