AdminStatsBlockServiceTest.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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\AdminStatsBlockService;
  13. use Sonata\BlockBundle\Test\AbstractBlockServiceTestCase;
  14. /**
  15. * @author Sullivan Senechal <soullivaneuh@gmail.com>
  16. */
  17. class AdminStatsBlockServiceTest extends AbstractBlockServiceTestCase
  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 AdminStatsBlockService('foo', $this->templating, $this->pool);
  31. $blockContext = $this->getBlockContext($blockService);
  32. $this->assertSettings(array(
  33. 'icon' => 'fa-line-chart',
  34. 'text' => 'Statistics',
  35. 'color' => 'bg-aqua',
  36. 'code' => false,
  37. 'filters' => array(),
  38. 'limit' => 1000,
  39. 'template' => 'SonataAdminBundle:Block:block_stats.html.twig',
  40. ), $blockContext);
  41. }
  42. }