/**
* Tests the getPost() method.
*
* @dataProvider postProvider
*/
public function testGetPost($key, $input, $value, $expected)
{
$widget = $this->getMock('Contao\\Widget');
$class = new \ReflectionClass('Contao\\Widget');
$method = $class->getMethod('getPost');
$method->setAccessible(true);
$_POST[$input] = $value;
Input::resetCache();
Input::initialize();
$this->assertEquals($expected, $method->invoke($widget, $key));
}