BaseGroupedMapperTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This file is part of the Sonata 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\Mapper;
  11. use Sonata\AdminBundle\Mapper\BaseGroupedMapper;
  12. /**
  13. * Test for BaseGroupedMapper
  14. *
  15. * @author Andrej Hudec <pulzarraider@gmail.com>
  16. */
  17. class BaseGroupedMapperTest extends \PHPUnit_Framework_TestCase
  18. {
  19. /**
  20. * @var BaseGroupedMapper
  21. */
  22. protected $baseGroupedMapper;
  23. public function setUp()
  24. {
  25. $admin = $this->getMock('Sonata\AdminBundle\Admin\AdminInterface');
  26. $builder = $this->getMock('Sonata\AdminBundle\Builder\BuilderInterface');
  27. $this->baseGroupedMapper = $this->getMockForAbstractClass('Sonata\AdminBundle\Mapper\BaseGroupedMapper', array($builder, $admin));
  28. }
  29. public function testWith()
  30. {
  31. $this->assertEquals($this->baseGroupedMapper, $this->baseGroupedMapper->with('fooGroup'));
  32. }
  33. public function testEnd()
  34. {
  35. $this->assertEquals($this->baseGroupedMapper, $this->baseGroupedMapper->with('fooGroup'));
  36. }
  37. }