* * 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 */ 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); } }