/** * Get a value from $_POST param for the given $key. * If key doesn't not exist, $value will be returned and assigned under that key. * * @param string $key Key for which you wish to get the value. * @param mixed $value Default value that will be returned if $key doesn't exist. * * @return mixed Value of the given $key. */ public function post($key = null, $value = null) { return $this->isNull($key) ? $this->post->getAll() : $this->post->get($key, $value); }
public function testGetAll() { $_POST = ["name" => "jack", "surname" => "doe"]; $post = new Post(); $this->assertSame($_POST, $post->getAll()); }