Created
March 2, 2011 16:04
-
-
Save johnwards/851159 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the Symfony package. | |
* | |
* (c) Fabien Potencier <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace Symfony\Tests\Component\Form\Renderer; | |
use Symfony\Component\Form\Renderer\DefaultRenderer; | |
use Symfony\Component\Form\Renderer\Theme\ThemeInterface; | |
use Symfony\Component\Form\Renderer\Plugin\PluginInterface; | |
class DefaultRendererTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testSetGetVar() | |
{ | |
$theme = $this->getMock('Symfony\Component\Form\Renderer\Theme\ThemeInterface'); | |
$plugin = $this->getMock('Symfony\Component\Form\Renderer\Plugin\PluginInterface'); | |
$plugin->expects($this->once()) | |
->method('setUp') | |
->will($this->returnCallback(function($r){ | |
$r->setVar('testing', "fooBar"); | |
})); | |
$renderer = new DefaultRenderer($theme, null); | |
$renderer->addPlugin($plugin); | |
$this->assertEquals('fooBar',$renderer->getVar('testing')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment