SelectMultipleNamePluginTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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\Renderer\Plugin;
  11. use Symfony\Component\Form\Renderer\Plugin\SelectMultipleNamePlugin;
  12. class SelectMultipleNamePluginTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function testSetUp()
  15. {
  16. $field = $this->getMock('Symfony\Tests\Component\Form\FormInterface');
  17. $renderer = $this->getMock('Symfony\Component\Form\Renderer\FormRendererInterface');
  18. $renderer->expects($this->once())
  19. ->method('getVar')
  20. ->with($this->equalTo('name'))
  21. ->will($this->returnValue('multiname'));
  22. $renderer->expects($this->once())
  23. ->method('setVar')
  24. ->with($this->equalTo('name'), $this->equalTo('multiname[]'));
  25. $plugin = new SelectMultipleNamePlugin();
  26. $plugin->setUp($field, $renderer);
  27. }
  28. }