BaseMapperTest.php 1.1 KB

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