BaseGroupedMapperTest.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. $this->baseGroupedMapper->expects($this->any())->method('getTabs')->will($this->returnValue(array()));
  29. }
  30. public function testWith()
  31. {
  32. $this->assertEquals($this->baseGroupedMapper, $this->baseGroupedMapper->with('fooGroup'));
  33. }
  34. public function testEnd()
  35. {
  36. $this->assertEquals($this->baseGroupedMapper, $this->baseGroupedMapper->with('fooGroup'));
  37. }
  38. }