Skip to content

Instantly share code, notes, and snippets.

@johnwards
Created March 1, 2011 13:03
Show Gist options
  • Save johnwards/849084 to your computer and use it in GitHub Desktop.
Save johnwards/849084 to your computer and use it in GitHub Desktop.
FieldPluginTest.php
<?php
namespace Symfony\Tests\Component\Form\Renderer\Plugin;
use Symfony\Component\Form\Renderer\Plugin\FieldPlugin;
use Symfony\Component\Form\Renderer\DefaultRenderer;
use Symfony\Component\Form\FieldInterface;
class FieldPluginTest extends \PHPUnit_Framework_TestCase
{
public function testSetUpSetsValue()
{
$field = $this->getMock('Symfony\Component\Form\FieldInterface');
$field->expects($this->any())
->method('getDisplayedData')
->will($this->returnValue('bar'));
$field->expects($this->any())
->method('hasParent')
->will($this->returnValue(false));
$renderer = $this->getMock('Symfony\Component\Form\Renderer\RendererInterface');
$renderer->expects($this->exactly(11))
->method('setVar');
$plugin = new FieldPlugin($field);
$plugin->setUp($renderer);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment