BaseMapperTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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\Mapper;
  11. use Sonata\AdminBundle\Admin\AdminInterface;
  12. use Sonata\AdminBundle\Mapper\BaseMapper;
  13. /**
  14. * Test for BaseMapperTest.
  15. *
  16. * @author Andrej Hudec <pulzarraider@gmail.com>
  17. */
  18. class BaseMapperTest extends \PHPUnit_Framework_TestCase
  19. {
  20. /**
  21. * @var BaseMapper
  22. */
  23. protected $baseMapper;
  24. /**
  25. * @var AdminInterface
  26. */
  27. protected $admin;
  28. public function setUp()
  29. {
  30. $this->admin = $this->getMockForAbstractClass('Sonata\AdminBundle\Admin\AdminInterface');
  31. $builder = $this->getMockForAbstractClass('Sonata\AdminBundle\Builder\BuilderInterface');
  32. $this->baseMapper = $this->getMockForAbstractClass('Sonata\AdminBundle\Mapper\BaseMapper', array($builder, $this->admin));
  33. }
  34. public function testGetAdmin()
  35. {
  36. $this->assertSame($this->admin, $this->baseMapper->getAdmin());
  37. }
  38. }