public function testPostWithinMockedEnvironment() { $posted = RequestWrapper::getPost('post_post_field', 'Bob'); $this->assertEquals('Bob', $posted); $default = RequestWrapper::getPost('blah_doesnt_exist', 7777); $this->assertEquals(7777, $default); }
/** * Wrapper around the post variables as a clean way to get input. */ function post($key, $default_val = null) { $post = RequestWrapper::getPost($key); return isset($post) ? $post : $default_val; }
public function postSelfUse() { $act = RequestWrapper::getPost('act'); $url = 'skill/self_use/' . rawurlencode($act) . '/'; // TODO: Need to double check that this doesn't allow for redirect injection return new RedirectResponse(WEB_ROOT . $url); }