* * 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\AdminSearchBlockService; use Sonata\AdminBundle\Search\SearchHandler; use Sonata\BlockBundle\Test\AbstractBlockServiceTestCase; /** * @author Sullivan Senechal */ class AdminSearchBlockServiceTest extends AbstractBlockServiceTestCase { /** * @var Pool */ private $pool; /** * @var SearchHandler */ private $searchHandler; protected function setUp() { parent::setUp(); $this->pool = $this->getMockBuilder('Sonata\AdminBundle\Admin\Pool')->disableOriginalConstructor()->getMock(); $this->searchHandler = $this->getMockBuilder('Sonata\AdminBundle\Search\SearchHandler')->disableOriginalConstructor()->getMock(); } public function testDefaultSettings() { $blockService = new AdminSearchBlockService('foo', $this->templating, $this->pool, $this->searchHandler); $blockContext = $this->getBlockContext($blockService); $this->assertSettings(array( 'admin_code' => false, 'query' => '', 'page' => 0, 'per_page' => 10, 'icon' => '', ), $blockContext); } }