TestCase.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  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 Symfony\Tests\Component\Form;
  11. use Symfony\Component\Form\FormFactory;
  12. class TestCase extends \PHPUnit_Framework_TestCase
  13. {
  14. protected $theme;
  15. protected $csrfProvider;
  16. protected $validator;
  17. protected $fieldFactory;
  18. protected $storage;
  19. private $em;
  20. protected $factory;
  21. protected function setUp()
  22. {
  23. $this->theme = $this->getMock('Symfony\Component\Form\Renderer\Theme\ThemeInterface');
  24. $this->csrfProvider = $this->getMock('Symfony\Component\Form\CsrfProvider\CsrfProviderInterface');
  25. $this->validator = $this->getMock('Symfony\Component\Validator\ValidatorInterface');
  26. $this->fieldFactory = $this->getMock('Symfony\Component\Form\FieldFactory\FieldFactoryInterface');
  27. $this->storage = $this->getMockBuilder('Symfony\Component\HttpFoundation\File\TemporaryStorage')
  28. ->disableOriginalConstructor()
  29. ->getMock();
  30. $this->em = $this->getMockBuilder('Doctrine\ORM\EntityManager')
  31. ->disableOriginalConstructor()
  32. ->getMock();
  33. $this->factory = new FormFactory($this->theme, $this->csrfProvider,
  34. $this->validator, $this->fieldFactory, $this->storage, $this->em);
  35. }
  36. }