AdminListBlockServiceTest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /*
  3. * This file is part of the Sonata Project package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\AdminBundle\Tests\Block;
  11. use Sonata\AdminBundle\Admin\Pool;
  12. use Sonata\AdminBundle\Block\AdminListBlockService;
  13. use Sonata\BlockBundle\Tests\Block\AbstractBlockServiceTest;
  14. /**
  15. * @author Sullivan Senechal <soullivaneuh@gmail.com>
  16. */
  17. class AdminListBlockServiceTest extends AbstractBlockServiceTest
  18. {
  19. /**
  20. * @var Pool
  21. */
  22. private $pool;
  23. protected function setUp()
  24. {
  25. parent::setUp();
  26. $this->pool = $this->getMockBuilder('Sonata\AdminBundle\Admin\Pool')->disableOriginalConstructor()->getMock();
  27. }
  28. public function testDefaultSettings()
  29. {
  30. $blockService = new AdminListBlockService('foo', $this->templating, $this->pool);
  31. $blockContext = $this->getBlockContext($blockService);
  32. $this->assertSettings(array(
  33. 'groups' => false,
  34. ), $blockContext);
  35. }
  36. public function testOverriddenDefaultSettings()
  37. {
  38. $blockService = new FakeBlockService('foo', $this->templating, $this->pool);
  39. $blockContext = $this->getBlockContext($blockService);
  40. $this->assertSettings(array(
  41. 'foo' => 'bar',
  42. 'groups' => true,
  43. ), $blockContext);
  44. }
  45. }